Twilio Message

From docs
Revision as of 05:32, 21 July 2026 by Ashley DeBon (talk | contribs) (Successful Response (200))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Mobile_API »Get Message Contacts

Base URL

https://apimobile.callproof.com

Endpoint

/api/message-contacts

Purpose

Retrieves a paginated list of messaging contacts for the authenticated user’s company. Each row represents the latest SMS thread per contact phone number, including the latest message preview, unread count, and related contact details. Results can optionally be filtered by a search term.

HTTP Method

POST

Headers

Header Required Description
Authorization Yes Bearer access token

Security

  • Yes – Requires Bearer Token authentication.

Parameters

Path Parameters

None.

Query Parameters

Parameter Type Required Description
page integer No Page number for pagination (default: 1). Page size is 10

Request Body

Parameter Type Required Description
search string No Search text applied across contact first/last name, company name, phone number, message text, and related personnel names
page integer No Page number for pagination (can also be sent as a query parameter)

cURL Example for Android

 curl --location 'https://apimobile.callproof.com/api/message-contacts?page=1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "search": "", "page": 1 }' 

cURL Example for iOS

 curl --location 'https://apimobile.callproof.com/api/message-contacts?page=1' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "search": "", "page": 1 }' 

Successful Response (200)

Returns a paginated list of message contacts / latest conversation previews.

Field Type Description
clientStatusCode integer Status indicator for the client (for example, 200)
user_id integer Identifier of the authenticated user
company_id integer Identifier of the authenticated user’s company
data array List of message contact records
firstItemOnPage integer Index of the first item on the current page
lastItemOnPage integer Index of the last item on the current page
hasNextPage boolean Whether a next page is available
hasPreviousPage boolean Whether a previous page is available
isFirstPage boolean Whether the current page is the first page
isLastPage boolean Whether the current page is the last page
next_page_url string/null URL of the next page, when available
prev_page_url string/null URL of the previous page, when available
first_page_url string URL of the first page
last_page_url string URL of the last page
pageCount integer Total number of pages
pageNumber integer Current page number
pageSize integer Number of items per page (10)
totalItemCount integer Total number of matching message contacts
uri string Requested resource URI

data[]

Field Type Description
message_id integer Identifier of the latest message in the thread
message string Latest message text preview
message_date string Latest message date in the user’s timezone (format: m/d/Y)
message_time string Latest message time in the user’s timezone (format: g:i A)
contact_phone_id integer Contact phone identifier for the thread
from_number string Phone number associated with the thread
from_name string Contact or personnel display name
twilio_phone_id integer Twilio phone identifier used for the conversation
rep_name string Name of the rep/user associated with the latest message
store_id integer/null Dealer/store identifier, when available
contact_type string Twilio SMS type name
contact_id integer Contact identifier
unread_count integer Number of unread messages for this contact phone thread
company_name string Contact company name
image string Contact/personnel image URL, when available

Error Responses

Status Code Meaning
400 Bad Request – message contacts could not be retrieved
401 Unauthorized – missing, invalid, or expired Bearer token
  • 400 – An error occurred while loading message contacts (for example, "Error while retrieving the message contact details").
  • 401 – Authentication failed or the access token is missing/expired.