API REFERENCEv1
Add Contact
POST
https://api2.protexting.com/v1/contacts/create⌘
Pass your server-side token as access_token. Replace sample values with your own. Authentication & setup →
Request parameters:
* required parameters
| Parameter | Description |
|---|---|
| * fnumber | string, valid phone number |
| ffirstname | string, max 100 symbols |
| flastname | string, max 100 symbols |
| fbirthdate | date |
| femail | string, max 64 symbols, validation against email format |
| fzipcode | string |
| fcity | string |
| * GroupIds | Array of group Ids |
| Message | string, max 148 symbols, validation against forbidden words (https://www.protexting.com/developers/docs/forbidden-words-phrases) |
| frfield | int, Custom Field Id |
| fvalue | string, max 255, Custom Field Value |
Example Request:
Request example
# Set PROTEXTING_ACCESS_TOKEN in your environmentcurl --request POST \ "https://api2.protexting.com/v1/contacts/create?access_token=${PROTEXTING_ACCESS_TOKEN:?Set your API token}" \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "fnumber": "16461234567", "ffirstname": "John", "GroupIds": [ 1 ], "Message": "Welcome to our text messaging list. You will be receiving up to 2 SMS with updates/month", "frfield": 1, "fvalue": "[email protected]"}'Example Response Headers:
Response headers example
Status Code: 201 Created
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Length: 243
Content-Type: application/json; charset=UTF-8
Keep-Alive: timeout=5, max=100
Pragma: no-cache
X-Powered-By: PHP/5.6.2
X-Rate-Limit-Limit: 60
X-Rate-Limit-Remaining: 59
X-Rate-Limit-ResetExample Response Body:
JSON response example
{
"Id": 1,
"Number": "16461234567",
"OptedOut": 0,
"FirstName": "John",
"LastName": "",
"BirthDay": "0000-00-00",
"Email": "",
"Zip": "",
"City": "",
"DateCreated": "2015-01-20 10:21:29",
"DateUpdated": "2015-01-20 10:41:29",
"GroupIds":[1],
"CustomFieldIds":[]
}XML response example
<response> <item> <Id>1</Id> <Number>16461234567</Number> <OptedOut>0</OptedOut> <FirstName>John</FirstName> <LastName /> <BirthDay>0000-00-00</BirthDay> <Email /> <Zip /> <City /> <DateCreated>2015-01-20 10:21:29</DateCreated> <DateUpdated>2015-01-20 10:41:29</DateUpdated> <GroupIds> <item>1</item> </GroupIds> <CustomFieldIds /> </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 »
Reference from the ProTexting documentation catalog. Code examples are illustrative; this page does not execute API requests.