ShoutOUT logo

Getting Started Edit

Welcome to ShoutOUT Developer Documentation.

This API document is designed for those interested in developing for our platform.

This API is still under development and will evolve.

Authentication Edit

You need to be authenticated for all API requests. You can generate an API key in our developer dashboard.

Add the API key to all requests as a header

Nothing will work unless you include this API key

 Authorization: Apikey <API_KEY>

Errors Edit

Code Name Description
200 OK Success
201 Created Creation Successful
400 Bad Request We could not process that action
403 Forbidden We couldn’t authenticate you

All errors will return JSON in the following format:

{
  "message": "error message here"
}

Introduction Edit

Integrate Lite API to your application to begin sending and receiving messages to your contacts from your system.

Incoming SMS

Outgoing SMS

/messages Edit

Send SMS Message

Parameters
source
Sender mask (Alias)
destinations
Mobile numbers in E.164 format
content
JSON object with key "sms" and the message content in the value
transports
String array, ["sms"]

Message will be logged and can be viewed from the dashboard

Send sms message(s) to the destination addresse(s)

$.post("https://api.getshoutout.com.com/coreservice/messages", {
  "source": "ShoutDEMO",
  "destinations": ["+94777123456"],
  "content": {
    "sms":"Sent via SMS Gateway"
  },
  "transports":["sms"]
}, function(data) {
  alert(data);
});
curl -X POST 
--header 'Content-Type: application/json' 
--header 'Accept: application/json' 
--header 'Authorization: Apikey <API_KEY>' 
-d '{
  source: 'ShoutDEMO',
  destinations: ['94777123456'],
  content: {
      sms: 'Sent via SMS Gateway'
  },
  transports: ['sms']
}' 'https://api.getshoutout.com/coreservice/messages'
{
  "id": 3,
  "title": "The Book Thief",
  "score": 4.3,
  "dateAdded": "5/1/2015"
}
{
  "error": true,
  "message": "Invalid score"
}

/logs/{id} Edit

Get log for message id

Parameters
id
Message id

Message id should be mentioned on the path

$.get("https://api.getshoutout.com.com/coreservice/logs/{id}", {
}, function(data) {
  alert(data);
});
curl -X GET 
--header 'Content-Type: application/json' 
--header 'Accept: application/json' 
--header 'Authorization: Apikey <API_KEY>' 
'https://api.getshoutout.com/coreservice/logs/{id}'
{
  "id": "{id}",
  "status": "1000"
}

Message Status
  1000 - Queued
  1001 - Sucess
  1010 - Internal Error
  1012 - No Route
  1015 - Blocked
  1026 - Submitted

Introduction Edit

Build and manage your contacts and their respective activities using our CRM API service. This enables developers to integrate our CRM to any system or application.

User Registration

  1. Merchant submit the customer details to loyalty service using one of the following
    • Hosted registration form
    • Embedded registration form
    • Direct API call
  2. Optionally customer receives a SMS or an Email with a welcome message and details of his/her loyalty account

Point Collection

  1. Merchant record customer transactions in the PoS system
  2. PoS system sends the bill value along with other transaction details to the collect points API endpoint of ShoutOUT Loyalty service
  3. ShoutOUT Loyalty service calculate the points for the bill value and accumulate it to the customer points pool
  4. Optionally a SMS or an Email is sent to the customer with the details of the transaction and points accumulation.

RESTful API

We have a very simple RESTful API with mainly four endpoints. And all endpoints receives request data as JSON objects.

  1. Register User
  2. Load User
  3. Collect Points
  4. Redeem Points

/contacts Edit

Create or update contact(s)

Parameters
user_id
Unique attribute to identify a person in your people list (Ex:- Mobile Number, Email or System Generated User ID)
name
Name of the person
mobile_number
Mobile number of the person in E.164 format
email
Email of the person
tags
String array of tags (Ex:- ["lead","employee"])

Additionally to above default parameters, you can define your own custom parameters

Create or update contact(s)

$.post("https://api.getshoutout.com.com/coreservice/contacts", [{
  "user_id": "94777123456",
  "name": "Duke",
  "mobile_number": "94777123456",
  "email": "duke@test.com"
}], function(data) {
  alert(data);
});
[
  {
    "user_id": "94777123456",
    "name": "Duke",
    "mobile_number": "94777123456",
    "email": "duke@test.com",
    "country_code": "LK",
    "country": "Sri Lanka",
    "_mobile_number_valid": true,
    "_email_valid": true,
    "id": "xxxxxxxxxxxxxxxxxxxx"
  }
]
{
  "message": "Authentication Failure!"
}

/activities Edit

Create Activity

Parameters
userId
Userid which was used to create the contact
activityName
Name of the activity
activityData
JSON object with arbitary data

A new event will be created with the activity name if not already created

Create an activity for the user

$.post("https://api.getshoutout.com.com/coreservice/activities", {
  "userId":"94777123456",
  "activityName":"Test Event",
  "activityData":{
    "param1":"val1"
  }
}, function(data) {
  alert(data);
});
{
  "userId": "94777123456",
  "activityName": "Test Event",
  "activityData": {
    "param1": "val1"
  },
  "createdOn": "2019-01-11T07:35:24.054Z",
  "_id": "xxxxxxxxx",
  "eventId": "3a3be55cafb08ed1878fe0ab7dbxxxxxxxx",
  "contactId": "66f019b8c509667d065055e4xxxxxx"
}
{
  "message": "Authentication Failure!"
}

Introduction Edit

Easy mobile number verification service available as an API. This service allows an application to easily send a system generated code to a mobile number and verify it programmatically. This can be used for two factor authentication, mobile number verification and one time password (magic passwords) like use cases.

How it Works

  1. User provide mobile number to your application
  2. Your application make send OTP request to OTP service with mobile number and store the reference id received
  3. OTP service send a SMS with a code to the mobile number
  4. User provide the received code to your application
  5. Your application make verify OTP request to OTP service with code and reference id and receive the verify status

/otp/send Edit

Send One Time Password

Parameters
source
Sender mask (Alias)
destination
Mobile number in E.164 format
content
JSON object with key "sms" and the message content in the value
transport
sms

Make sure you include {{code}} in your message content

System generated one time passcode will be sent to the mobile number

curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Authorization: Apikey <API_KEY>'
-d '{
  "destination": "94777123456",
  "source": "ShoutDEMO",
  "transport": "sms",
  "content": {
    "sms": "Hi Duke! Your code is {{ "{{code" }}}}"
  }
}' 'https://api.getshoutout.com/otpservice/otp/send'
{
 "referenceId": "f437c171-2d08-48c8-a4a2-xxxxxxxx",
 "messageResult": {
   "status": "1001",
   "description": "submit success",
   "cost": 1,
   "responses": [{
     "destination": "94711234567",
     "reference_id": "82ec4200-d386-11e8-b097-xxxxxxxxxxx",
     "status": "1001",
     "cost": 1
   }]
 } 
}
{
  "message": "<error message>"
}

/otp/verify Edit

Send One Time Password

Parameters
code
One time password
referenceId
Refence id received in send otp response

If valid successful response will be received

curl -X POST
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header 'Authorization: Apikey <API_KEY>'
-d '{
  "code": "ABCDE",
  "referenceId": "f437c171-2d08-48c8-a4a2-xxxxxxxx"
}' 'https://api.getshoutout.com/otpservice/otp/verify'
{
  "referenceId": "f437c171-2d08-48c8-a4a2-xxxxxxxx",
  "code": "87XXX",
  "statusCode": "1000",
  "description": "verification success"
}
{
   "message": "<error message>"
}

Introduction Edit

Loyalty service available as an API. This service allows a merchant to easily integrate a loyalty system to a business which serves customers

User Registration

  1. Merchant submit the customer details to loyalty service using one of the following
    • Hosted registration form
    • Embedded registration form
    • Direct API call
  2. Optionally customer receives a SMS or an Email with a welcome message and details of his/her loyalty account

Point Collection

  1. Merchant record customer transactions in the PoS system
  2. PoS system sends the bill value along with other transaction details to the collect points API endpoint of ShoutOUT Loyalty service
  3. ShoutOUT Loyalty service calculate the points for the bill value and accumulate it to the customer points pool
  4. Optionally a SMS or an Email is sent to the customer with the details of the transaction and points accumulation.

RESTful API

We have a very simple RESTful API with mainly four endpoints. And all endpoints receives request data as JSON objects.

  1. Register User
  2. Load User
  3. Collect Points
  4. Redeem Points

Enroll User Edit

Enroll user to the loyalty program

This is a merchant specific endpoint and is created upon request based on the merchant specific parameters

/users/:id Edit

Load user profile

:id is the value of user’s loyalty id

Returns the profile of the user

$.get("https://api.getshoutout.com/loyaltyservice/users/:id", {
}, function(data) {
  alert(data);
});
{
  "name": "John",
  "loyalty_id": "LOYAL-USER-001",
  "points": 17,
  "tier": "Level 1",
  "tier_points": 15,
  "benefits": [
    "10% Discount on all products"
  ]
}
{
  "message": "<error message>"
}

/points Collect Edit

Add points to user

Parameters
userId
Loyalty id of the user
activityData
JSON object with required key "bill" or "points" and any other arbitary keys

Make sure you include either bill or points in the activityData object

Points will be calculated by the system and added to the user accordingly

curl -X POST \
  https://api.getshoutout.com/loyaltyservice/points?action=collect \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json' \
  -d '{
  "userId":"LOYAL-USER-001",
  "activityData":{
    "bill":2350.00,
    "bill_number":"INV-001",
    "employee":"Smith",
    "location":"Main Branch"
  }
}'
{
  "points": 100,
   "tier_points": 1,
  "total_points": 200,
  "loyalty_id": "SPO-1"
}
{
  "message": "<error message>"
}

/points Redeem Edit

Redeem points from a user

Parameters
userId
Loyalty id of the user
activityData
JSON object with required key "points" and any other arbitary keys

Make sure you include either points in the activityData object

Points will be redeemed from the user’s loyalty account

curl -X POST \
  https://api.getshoutout.com/loyaltyservice/points?action=redeem \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json' \
  -d '{
  "userId":"LOYAL-USER-001",
  "activityData":{
    "points":17,
    "employee":"Smith",
    "location":"Main Branch"
  }
}'
{ 
  "points": 10,
  "balance_points": 290,
  "loyalty_id": "SPO-1"
}
{
  "message": "<error message>"
}

Introduction Edit

Reward API service available to manage(add new, delete and edit) rewards and allow users to purchase rewards affordable to them from the loyalty program.

/rewards Edit

Create Reward

Parameters
rewardName
Name of the reward
points
Number of points required to redeem the reward
rewardStatus
Status of the reward (0-Unpublished,1-Published)
imageUrls
Array of image urls

Points will be redeemed from the user’s loyalty account

curl -X POST \
  https://api.getshoutout.com/loyaltyservice/points \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json' \
  -d '{
  "userId":"LOYAL-USER-001",
  "activityData":{
  "points":-17,
  "employee":"Smith",
  "location":"Colombo"
  }
}'
{
  "rewardName": "Sample Reward",
  "points": 10,
  "imageUrls": ["https://gallery.getshoutout.com/sample.jpeg"],
  "rewardStatus": 0,
  "rewardId": "bc0c9680-59be-11e8-82ea-7154ab678cae",
  "createdOn": "2018-05-01T10:40:36.841Z",
  "updatedOn": "2018-05-01T10:40:36.841Z"
}
{
  "message": "Something went wrong"
}

/rewards Edit

Update Reward

Parameters
rewardId
Reward id
rewardName
Name of the reward
points
Number of points required to redeem the reward
rewardStatus
Status of the reward (0-Unpublished,1-Published)
imageUrls
Array of image urls

Points will be redeemed from the user’s loyalty account

curl -X POST \
  https://api.getshoutout.com/loyaltyservice/points \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json' \
  -d '{
  "userId":"LOYAL-USER-001",
  "activityData":{
  "points":-17,
  "employee":"Smith",
  "location":"Colombo"
  }
}'
{
  "rewardStatus": 1,
  "updatedOn": "2018-05-17T10:47:02.982Z",
  "rewardName": "Sample Reward",
  "createdOn": "2018-05-01T10:40:36.841Z",
  "points": 10,
  "rewardId": "bc0c9680-59be-11e8-82ea-7154ab678cae",
  "imageUrls": ["https://gallery.getshoutout.com/sample.jpeg"]
}
{
  "message": "Something went wrong"
}

/rewards/:id Edit

Delete reward

Reward with the id mentioned on the url will be deleted

curl -X DELETE \
  https://api.getshoutout.com/loyaltyservice/rewards/bc0c9680-59be-11e8-82ea-7154ab678cae \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json'
}'
{}
{
  "message": "Something went wrong"
}

/rewards Edit

Get rewards

Points will be redeemed from the user’s loyalty account

curl -X GET \
  https://api.getshoutout.com/loyaltyservice/rewards \
  -H 'authorization: Bearer <API_KEY>' \
  -H 'content-type: application/json'
}'
{
  "Items": [{
    "rewardStatus": 1,
    "updatedOn": "2018-05-17T10:47:02.982Z",
    "rewardName": "Sample Reward",
    "createdOn": "2018-05-01T10:40:36.841Z",
    "points": 10,
    "rewardId": "bc0c9680-59be-11e8-82ea-7154ab678cae",
    "imageUrls": ["https://gallery.getshoutout.com/sample.jpeg"]
  }],
  "Count": 1
}
{
  "message": "Something went wrong"
}