إرسال
Project

List Project Contacts

Retrieve contacts from a specific contact group in the project

Endpoint

GET /api/project/contacts/{group_id}

Path parameters

FieldTypeDescription
group_idstring (UUID)The ID of the contact group

Query parameters

FieldTypeRequiredDescription
pageintegerNoPage number, minimum 1 (default: 1)
per_pageintegerNoResults per page, minimum 1 (default: 10)
fromdateNoFilter contacts created on/after this date (YYYY-MM-DD)
todateNoFilter contacts created on/before this date (YYYY-MM-DD)

Contacts are returned newest first.

Example

curl "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1&per_page=10" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Response

The response is wrapped in a data key containing a Laravel paginator object:

{
  "data": {
    "current_page": 1,
    "data": [
      {
        "name": "أحمد محمد",
        "phone": "00218912345678",
        "sex": "male",
        "birthdate": "1992-03-12T00:00:00Z",
        "city": null
      }
    ],
    "first_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1",
    "from": 1,
    "last_page": 3,
    "last_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=3",
    "links": [
      { "url": null, "label": "« Previous", "active": false },
      { "url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=1", "label": "1", "active": true },
      { "url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=2", "label": "Next »", "active": false }
    ],
    "next_page_url": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12?page=2",
    "path": "https://sms.lamah.com/api/project/contacts/9db1f9a3-3b8e-4a7d-91d0-4c0ccf7c0b12",
    "per_page": 10,
    "prev_page_url": null,
    "to": 10,
    "total": 30
  }
}

Top-level response fields

FieldTypeDescription
dataobjectLaravel paginator object

Pagination fields

FieldTypeDescription
current_pageintegerCurrent page number
dataarrayContact records on the current page
first_page_urlstringURL of the first page
frominteger|nullIndex of the first record on the current page
last_pageintegerTotal number of pages
last_page_urlstringURL of the last page
linksarrayLaravel pagination navigation links
next_page_urlstring|nullURL of the next page
pathstringBase URL for this paginated resource
per_pageintegerResults per page
prev_page_urlstring|nullURL of the previous page
tointeger|nullIndex of the last record on the current page
totalintegerTotal number of contacts in the group

Contact object fields

FieldTypeDescription
namestringContact name
phonestringPhone number in international format
sexstring|nullGender if provided
birthdatestring|nullBirthdate if provided (ISO 8601)
citystring|nullCity if provided

Error responses

404 Not Found — Group not found

The group does not exist or is not linked to this project.

{ "message": "Contact group not found" }

422 Unprocessable Entity — Malformed group ID

{
  "message": "The group id field must be a valid UUID.",
  "errors": {
    "group_id": ["The group id field must be a valid UUID."]
  }
}

401 Unauthorized

{ "message": "Invalid or missing token." }
{ "message": "Unauthorized IP address." }

On this page