Advice and answers from the Retently Team

Here is our guide of the API.

1. LIST SUBSCRIBERS

Example URI: GET https://api.retently.com/api/retently/nps/customers

a) URI Parameters

  • currentPage: string (optional) Example: 1. The current page number. Default 1
  • limit: string (optional) Example: 20. The items limit. Default 20
  • sort: string (optional) Example: 'createdDate'. The sort option. Use ‘-’ for DESC. Default ‘-createdDate’

b) Request

Headers

Content-Type: application/json

Authorization: api_key={{api_key}}

c) Response:  200

Headers

Content-Type: application/json

Body

{

   "message": "success",

   "code": 200,

   "data": { … }

}

2. CREATE SUBSCRIBERS

Max number of subscribers by default is 100 per request.
Example URI: POST https://api.retently.com/api/retently/nps/customers

a) Parameters (with examples)

  • subscribers: (required, array) - An array of subscribers
  • email: john.smith@example.com (required, string) - Email address
  • first_name: john (required, string) - First name
  • last_name: smith (required, string) - Last name
  • company: ACME (required, string) - Company name

b) Request

Headers

Content-Type: application/json

Authorization: api_key={{api_key}}

Body

{

   "subscribers": [

       {

           "email": "john.smith@example.com",

           "last_name": "smith",

           "first_name": "jon"                    

           "companyName": "ACME"

       }

    ]

}

 

c) Response:  200

Headers

Content-Type: application/json

Body

{

 "message": "success",

 "code": 200

}

3. GET LATEST SCORE

Example URI: GET https://api.retently.com/api/retently/nps/score

a) Request

Headers

Content-Type: application/json

Authorization: api_key={{api_key}}

 

b) Response:  200

Headers

Content-Type: application/json

Body

{

 "message": "success",

 "code": 200,

 "data": {

   "nps": 100,

   "promoters": 100,

   "passives": 0,

   "detractors": 0,

   "promotersCount": 1,

   "passivesCount": 0,

   "detractorsCount": 0,

   "totalResponses": 1

 }

}

4) GET LATEST RESPONSE  

Example URI: GET https://api.retently.com/api/retently/nps/customers/response

a) URI Parameters

  • currentPage: string (optional) Example: 1. The current page number. Default 1
  • limit: string (optional) Example: 20. The items limit. Default 20
  • sort: string (optional) Example: 'DESC'. The sort option. Use ‘ASC’ for ascending. Default ‘DESC’
  • email: array (optional) Example: 'email[0]=john.doe@example.com'. Array of emails.

b) Request

Headers

Content-Type: application/json

Authorization: api_key={{api_key}}

 

c) Response: 200

Headers

Content-Type: application/json

Body

{

   "message": "success",

   "code": 200,

   "data":

       "subscribers": [ … ],

       "currentPage": "1",

       "totalNumberOfPages": 10,

       "limit": "10",

       "sortBy": "DESC",

       "total": 20         

}

 Thanks for reading our API guide.

Did this answer your question?