API REFERENCEv1

List Contacts

GEThttps://api2.protexting.com/v1/contacts/index

Pass your server-side token as access_token. Replace sample values with your own. Authentication & setup →

Response parameters:

ParameterDescription
IdPhone number Id
NumberPhone number
OptedOutIf the contact opted out
OptedOutViaApiIf the contact opted out from Contacts API (eligible to opt in via “Undo Opt Out Contacts” only)
FirstNameContact's first name
LastNameContact's last name
BirthDayContact's birthday
EmailContact's email
ZipContact's zip
CityContact's city
DateCreatedThe date when the record was created
DateUpdatedThe date when the record was updated
GroupIdsGroup Ids, array of integers, the Ids of the Groups the phone number is added to
CustomFieldsCustom Field data

Example Request:

Request example
# Set PROTEXTING_ACCESS_TOKEN in your environmentcurl --request GET \  "https://api2.protexting.com/v1/contacts/index?access_token=${PROTEXTING_ACCESS_TOKEN:?Set your API token}" \  --header 'Accept: application/json'
Server-side exampleJSON · HTTPS

Example Response Headers:

Response headers example
Status Code: 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Type: application/xml; charset=utf-8
Keep-Alive: timeout=5, max=100
Link: <https://api2.protexting.com/v1/contacts?access_token=your_access_token&page=1>; rel=self Pragma: no-cache Transfer-Encoding: chunked X-Pagination-Current-Page: 1 X-Pagination-Page-Count: 1 X-Pagination-Per-Page: 100 X-Pagination-Total-Count: 46 X-Powered-By: PHP/5.6.2 X-Rate-Limit-Limit: 60 X-Rate-Limit-Remaining: 59 X-Rate-Limit-Reset: 0

Example Response Body:

JSON response example
[
    {
        "Id": 1,
        "Number": "16461234567",
        "OptedOut": 0,        "OptedOutViaApi": 0,
        "FirstName": "John",
        "LastName": "Smith",
        "BirthDay": "0000-00-00",
        "Email": "",
        "Zip": "",
        "City": "",
        "DateCreated": "2015-01-20 10:21:29",
        "DateUpdated": "2015-01-20 10:21:29",
        "GroupIds": [1,2],
        "CustomFields":[            {                "CustomFieldId": 1,                "CustomFieldName":"Field Test",                "CustomFieldValueId": 11                "CustomFieldValue": "Test Value",             }         ]
    },
    {
        "Id": 2,
        "Number": "16461134567",
        "OptedOut": 0,        "OptedOutViaApi": 0,
        "FirstName": "Jane",
        "LastName": "",
        "BirthDay": "0000-00-00",
        "Email": "",
        "Zip": "",
        "City": "",
        "DateCreated": "2015-01-20 10:21:30",
        "DateUpdated": "2015-01-20 10:21:30",
        "GroupIds": [3],
        "CustomFields":[            {                "CustomFieldId": 2,                "CustomFieldName":"Field Test 2",                "CustomFieldValueId": 12                "CustomFieldValue": "Test Value 2",            }         ]
    }
    ...
]
XML response example
<response>   <item>      <Id>1</Id>      <Number>16461234567</Number>      <OptedOut>0</OptedOut>      <OptedOutViaApi>0</OptedOutViaApi>      <FirstName>John</FirstName>      <LastName>Smith</LastName>      <BirthDay>0000-00-00</BirthDay>      <Email/>      <Zip/>      <City/>      <DateCreated>2015-01-20 10:21:29</DateCreated>      <DateUpdated>2015-01-20 10:21:29</DateUpdated>      <GroupIds>         <item>1</item>         <item>2</item>      </GroupIds>      <CustomFields>          <item>              <CustomFieldId>1</CustomFieldId>              <CustomFieldName>Field Test</CustomFieldName>              <CustomFieldValueId>11</CustomFieldValueId>              <CustomFieldValue>Test Value</CustomFieldValue>          </item>       </CustomFields>   </item>   <item>      <Id>2</Id>      <Number>16461134567</Number>      <OptedOut>0</OptedOut>      <OptedOutViaApi>0</OptedOutViaApi>      <FirstName>Jane</FirstName>      <LastName></LastName>      <BirthDay>0000-00-00</BirthDay>      <Email/>      <Zip/>      <City/>      <DateCreated>2015-01-20 10:21:30</DateCreated>      <DateUpdated>2015-01-20 10:21:30</DateUpdated>      <GroupIds>         <item>3</item>      </GroupIds>      <CustomFields>          <item>              <CustomFieldId>2</CustomFieldId>              <CustomFieldName>Field Test 2</CustomFieldName>              <CustomFieldValueId>12</CustomFieldValueId>              <CustomFieldValue>Test Value 2</CustomFieldValue>          </item>       </CustomFields>    </item> ...</response>

HTTP Status Codes:

The standard HTTP Status Codes are used. More information is available here: http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

Error Codes:

Error Codes and Examples here »

Note:

If the contact opted out from Contacts API (eligible to opt in via “Undo Opt Out Contacts”)

Reference from the ProTexting documentation catalog. Code examples are illustrative; this page does not execute API requests.