latestSwagger 2.02026-08-101561322.2 MB

3e4029d19684

Contacts

Find contacts by given criteria

<a class="try-sandbox-link" href="https://sandbox.textmagic.com/#/Contacts/searchContacts" target="_blank">Try in sandbox</a><br>

get/api/v2/contacts/search

Query parameters

pageinteger

Fetch specified results page.

limitinteger

The number of results per page.

shared0 | 1

Should shared contacts be included?

idsstring

Find contacts by IDs.

listIdinteger

Find contacts by List ID.

includeBlocked0 | 1

Should blocked contacts be included?

querystring

Find contacts by specified search query.

local0 | 1

Treat phone number passed in the "query" field as local. Default is 0.

exactMatch0 | 1

Return only exactly matching contacts. Default is 0.

countrystring

The 2-letter ISO country code for local phone numbers, used when "local" is set to true. Default is the account country.

orderBy'id' | 'firstName' | 'lastName'

Order results by some field. Default is id.

direction'asc' | 'desc'

Order direction. Default is desc.

tagIdsstring

Find contacts by tag ID(s). Multiple IDs can be separated by comma.

Response

Found contacts have been returned with success.

pageinteger required
pageCountinteger required

The total number of pages.

limitinteger required

The number of results per page.

Example response

{
  "page": 1,
  "pageCount": 10,
  "limit": 10,
  "resources": [
    {
      "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": "&pound;"
        },
        "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": "&pound;"
            },
            "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": "&pound;"
        },
        "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": "&pound;"
            },
            "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"
            }
          }
        }
      ]
    }
  ]
}