Chats
Find chats by recipient
<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Chats/searchChatsByReceipent" target="_blank">Try in sandbox</a><br>Find chats by recipient (contact, list name or phone number).
get/api/v2/chats/search/recipients
Request
- Base URLhttps://rest.textmagic.com
- AuthHTTP basic
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
pageinteger
Fetch specified results page.
limitinteger
The number of results per page.
querystring
Find chats by specified search query.
orderBy'id' | 'unread' | 'messageTime'
Order results by some field. Default is id.
Response
Returned when successful.
Example response
{
"page": 1,
"pageCount": 10,
"limit": 10,
"resources": [
{
"id": 43328,
"originalId": 43328,
"contact": {
"id": 27074,
"favorited": true,
"blocked": true,
"firstName": "Charles",
"lastName": "Conway",
"companyName": "Example Ltd.",
"email": "charles@example.com",
"country": {
"id": "US",
"name": "India"
},
"customFields": [
{
"id": 515,
"userCustomFieldId": 515,
"name": "Custom name",
"value": "Custom value",
"createdAt": "2015-02-11T07:33:19+0000"
}
],
"user": {
"id": 305,
"displayTimeFormat": "24h",
"username": "charles.conway",
"firstName": "Charles",
"lastName": "Conway",
"email": "charles@example.com",
"status": "A",
"balance": 208.64,
"phone": "447860021130",
"company": "Example Ltd.",
"currency": {
"id": "GBP",
"unicodeSymbol": "£",
"htmlSymbol": "£"
},
"country": {
"id": "US",
"name": "India"
},
"timezone": {
"id": 55,
"area": "Europe",
"dst": 1,
"offset": 10800,
"timezone": "Europe\\/Tallinn"
},
"subaccountType": "P",
"emailAccepted": true,
"phoneAccepted": true,
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
}
},
"lists": [
{
"id": 715,
"name": "Private list",
"description": "Private contacts of C. R. Conway",
"membersCount": 332,
"user": {
"id": 305,
"displayTimeFormat": "24h",
"username": "charles.conway",
"firstName": "Charles",
"lastName": "Conway",
"email": "charles@example.com",
"status": "A",
"balance": 208.64,
"phone": "447860021130",
"company": "Example Ltd.",
"currency": {
"id": "GBP",
"unicodeSymbol": "£",
"htmlSymbol": "£"
},
"country": {
"id": "US",
"name": "India"
},
"timezone": {
"id": 55,
"area": "Europe",
"dst": 1,
"offset": 10800,
"timezone": "Europe\\/Tallinn"
},
"subaccountType": "P",
"emailAccepted": true,
"phoneAccepted": true,
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
}
},
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
}
}
],
"owner": {
"id": 305,
"displayTimeFormat": "24h",
"username": "charles.conway",
"firstName": "Charles",
"lastName": "Conway",
"email": "charles@example.com",
"status": "A",
"balance": 208.64,
"phone": "447860021130",
"company": "Example Ltd.",
"currency": {
"id": "GBP",
"unicodeSymbol": "£",
"htmlSymbol": "£"
},
"country": {
"id": "US",
"name": "India"
},
"timezone": {
"id": 55,
"area": "Europe",
"dst": 1,
"offset": 10800,
"timezone": "Europe\\/Tallinn"
},
"subaccountType": "P",
"emailAccepted": true,
"phoneAccepted": true,
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
}
},
"tags": [
{
"id": 23,
"title": "Red"
}
],
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
},
"notes": [
{
"id": 5,
"createdAt": "2015-06-19T09:48:24+0000",
"note": "Test note",
"user": {
"id": 305,
"displayTimeFormat": "24h",
"username": "charles.conway",
"firstName": "Charles",
"lastName": "Conway",
"email": "charles@example.com",
"status": "A",
"balance": 208.64,
"phone": "447860021130",
"company": "Example Ltd.",
"currency": {
"id": "GBP",
"unicodeSymbol": "£",
"htmlSymbol": "£"
},
"country": {
"id": "US",
"name": "India"
},
"timezone": {
"id": 55,
"area": "Europe",
"dst": 1,
"offset": 10800,
"timezone": "Europe\\/Tallinn"
},
"subaccountType": "P",
"emailAccepted": true,
"phoneAccepted": true,
"avatar": {
"href": "avatars/lav5d8de21d89971646555094.png"
}
}
}
]
},
"unsubscribedContactId": 546,
"unread": 5,
"updatedAt": "2015-01-08T06:13:21+0000",
"lastMessage": "Hello world!",
"replyOptionsType": "user_carrier_twilio",
"mutedUntil": "2019-10-10T14:44:00+0000",
"timeLeftMute": 17988,
"country": {
"id": "US",
"name": "India"
},
"pinned": true,
"type": "sms",
"smsPrice": 12.34,
"mmsPrice": 12.34,
"tags": [
{
"id": 23,
"title": "Red"
}
],
"assigneeId": 1,
"updatedBy": {
"id": 456,
"firstName": "John",
"lastName": "Smith",
"avatarUrl": "https://example.com/avatar.jpg",
"email": "john.smith@example.com"
},
"createdAt": "2015-01-08T06:13:21+0000",
"messageTime": "2015-01-08T06:13:21+0000",
"conversationEnded": true,
"rating": {
"rate": "good",
"comment": "Great support!"
}
}
]
}Changes
No recorded changes to this operation across all 4 revisions of this API.