Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 17 Current »

All the below endpoints require the reseller to authenticate themselves with a resellerName and a resellerPassword. A response with {"status":3} is returned when the provided credentials are invalid.

Status codes and their meaning: User and Reseller REST API Response Status Codes

Parameter names are case sensitive.

Create user and customer account

Rest End-point

URL: /services/rest/customer-user/create

method: POST


Note:  Customer Billing Type is defined by the Reseller property;  All Accounts are created with rotationAlgorithm = "CONVERSATION"

defaultCustomerBillingType

Parameters

namedescriptionexample valuevalidation rules
contactNameUser's contact nameJohn Doenone
emailUser's e-mail.john@doe.comoptional, but if provided must be a valid e-mail
usernameusername of the user to be created.1212412@testResellerrequired, can't contain spaces. For the phone applications we will use customer@reseller as the username.
passwordPasswordpasswordrequired
customerName of customerexampleCustomerrequired, can't contain spaces. Customer with given name must not exist. For the phone applications we will use customer@reseller as the customer name, the same like for username.
resellerNameName of resellerresellerNamerequired, can't contain spaces and '@'. Reseller with given name must exist
resellerPasswordReseller passwordpasswordrequired for authentication
phoneNumberPhone number to contact with user999444111optional, can contain only +, " " and digits, no other validation
applyFreeCreditsflag indicating whether we should add free credits to accountfalserequired, value must be either "true" or "false", case insensitive

Response

Reponse will be sent as a JSON with single value. Example:

{"status":0}

Possible statuses

0, 1, 2, 3, 201, 220, 301, 400, 9999 

Create user account

Rest End-point

URL: /services/rest/user/create

method: POST

Parameters

namedescriptionexample valuevalidation rules
usernameusername of the user to be created.1212412@testResellerrequired, can't contain spaces
passwordPasswordpasswordrequired
resellerNameName of resellerresellerNamerequired, can't contain spaces and '@'. Reseller with given name must exist
resellerPasswordReseller passwordpasswordrequired for authentication
customerIdID of the customer5a4e96a030046095c7ef280fmust be a valid Mongo ObjectId, the customer with the given ID has to exist
emailUser's e-mail.john@doe.comrequired, must be a valid e-mail
phoneNumberPhone number to contact with user999444111required, can contain only +, " " and digits, no other validation
finalStatusPushPush notification type for final message statuses
{"type": "URL", "data": {"url": "http://push.example.com"}}

optional, if present - must be a valid JSON with a typefield defining the notification type and an optional datafield with details of the given notification type; the supported notification types are:

  • URL: {"type": "URL", "data": {"url": "http://push.example.com"}}
  • e-mail: {"type": "EMAIL", "data": {"to": "user@example.com", "subject": "Message subject", "body": "Message body"}}
  • SMPP: {"type": "SMPP"}
swappingSourceAddressAllowedFlag indicating whether the source address can be swappedtrue

optional, value must be either "true" or "false", case insensitive, default: "false"

sourceAddressSource address to be used when the sender is absent from the original message48123456789

optional, if present must be either of:

  • 3-16 digits
  • 2-11 characters if any non-digit valid GSM character is present


Response

Reponse will be sent as a JSON with single value. Example:

{"id":"abc1234","status":0}

Possible statuses

0, 1, 2, 3, 201, 220, 300, 400, 9999 

Create customer

Rest End-point

URL: /services/rest/customer/create

method: POST

Parameters

namedescriptionexample valuevalidation rules
namename of the customer to be createdtest-customerrequired, can't contain spaces. Customer with given name must not exist.
resellerNameName of resellerresellerNamerequired, can't contain spaces and '@'. Reseller with given name must exist
resellerPasswordReseller passwordpasswordrequired for authentication
integrationIdID of the integrationintegrationIdRequired
rotationAlgorithmRotation algoritgmMAX_ROTATIONoptional, if present - must be one of: CONVERSATIONMAX_ROTATION; default: MAX_ROTATION
billingTypeBilling typePRE_PAIDoptional, if present - must be one of: PRE_PAIDPOST_PAID; default: POST_PAID even is reseller Default billing type is Pre-Paid
moChargeMO charge0optional, if present - must be a valid integer; default: 0
sourceAddressSource address to be used when the sender is absent from the original message and no source address is defined for the user sending the message48123456789

optional, if present must be either of:

  • 3-16 digits
  • 2-11 characters if any non-digit valid GSM character is present


Response

Reponse will be sent as a JSON with single value. Example:

{"id":"abc123","status":0}

Possible statuses

0, 1, 2, 3, 301, 400, 9999 

  • No labels