API Documentation

Here is a guide on how you can add new customers, using the API keys

  1. Log into your account on Cloudtxt
  2. Navigate to the API keys to create a new API key
  3. If you don’t have any keys generated yet, click Add API key.
  4. Input the key name and click Save. The key itself is generated automatically.
  5. Copy the API key from the list
  6. You will now be able to add subscribers using the API by setting up your API call in the following way:
                        curl  --request POST \
--url https://app.cloudtxt.com/api/customer/add \
--data '{
"source_id":"627346b1ac507",
"phone":"+79231783401",
"first_name":"John",
"last_name":"Smith",
"email":"jsmith@gmail.com"
}'

The request correctly process the following fields:

  • source_id (required)
  • phone (required)
  • First_name (optional)
  • Last_name (optional)
  • Email (optional)
When using the forms connected with an API key, you may see the following errors:

Error Reason
Could not decode JSON, syntax error - malformed JSON. Some of the fields do not meet JSON format requirements
400 Missing source_id API key (required field) is missing
400 Missing phone Phone number (required field) is missing
400 Invalid phone number Inserted phone number is invalid
400 Too long source_id Source ID length exceeds 20 characters
400 Too long phone Phone number length exceeds 11 digits
400 Too long first_name first_name length exceeds 20 characters
400 Too long last_name last_name length exceeds 20 characters
400 Too long email email length exceeds 20 characters
400 Wrong email Email format is not correct
404 No resource The key does not exist in a database or the key is disabled.