API REFERENCEv1

Undo Opt Out Contact

POSThttps://api2.protexting.com/v1/contacts-opt-in/create-custom

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

Request parameters:

* required parameters

ParameterDescription
* PhoneNumber string, valid phone number

Example Request:

Request example
# Set PROTEXTING_ACCESS_TOKEN in your environmentcurl --request POST \  "https://api2.protexting.com/v1/contacts-opt-in/create-custom?access_token=${PROTEXTING_ACCESS_TOKEN:?Set your API token}" \  --header 'Accept: application/json' \  --header 'Content-Type: application/json' \  --data '{  "PhoneNumber": "16461234567"}'
Server-side exampleJSON · HTTPS

Example Response Body:

JSON response example
{
        "message": "Phone number successfully opted in",
}
XML response example
<response>   <message>      Phone number successfully opted in   </message></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

Example HTTP Status Code:

Status Code

(response header)

Description

(response header)

Field

(response body)

Message

(response body)

422 Data Validation Failed The attribute that didn't pass the validation The message, describing the validation error

Error Codes:

Error Codes and Examples here »

Important:

  • The API call will work ONLY if the number has been opted out via the Opt out Contact API
  • Check if contact/s are eligible to opt in via the Contacts List API, with status OptedOutViaApi = 1
  • If contacts texted in STOP or they unsubscribed by other methods, they need to text in a KEYWORD in order to re-subscribe.

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