CONTENTS:

  • List subscribers
  • Create subscribers
  • List available templates
  • List available campaigns
  • List available tags
  • Create subscribers and send survey
  • Get latest score
  • Get latest response

__________________________________________________________________

LIST SUBSCRIBERS

Example URI: GET https://app.retently.com/api/v2/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": { … }

}

__________________________________________________________________

CREATE SUBSCRIBERS

Max number of subscribers by default is 100 per request.
Example URI: POST https://app.retently.com/api/v2/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 (optional, string) - First name
  • last_name: smith (optional, string) - Last name
  • company: ACME (optional, string) - Company name
  • tags: ["tag1"] (optional, array) - An array of tags

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",                    

           "company": "ACME",

           "tags": ["tag1","tag2","tag3"]

       }

    ]

}

c) Response:  200

Headers

Content-Type: application/json

Body

{
    “message”: “Subscribers was successfully added”,
    “code”: 200,
    “data”: {
    "john.smith@example.com”: {
            “status”: “created”
        }
    }
}

__________________________________________________________________

LIST AVAILABLE TEMPLATES

Example URI: GET https://app.retently.com/api/v2/nps/templates

a) Parameters (with examples)

    {}

b) Request

    Headers

        Content-Type: application/json

        Authorization: api_key={{api_key}}

    Body

        {}    


c) Response:  200

    [
        {
            "id": "5911d66ee008d0815f747000",
            "value": "Default email template"
        }
    ]

__________________________________________________________________

LIST AVAILABLE CAMPAIGNS

Example URI: GET https://app.retently.com/api/v2/nps/campaigns

a) Parameters (with examples)

    {}

b) Request

    Headers

        Content-Type: application/json

        Authorization: api_key={{api_key}}

    Body

        {}    

c) Response:  200

    [
        {
            "id": "5911d66ee008d0815f747000",
            "value": "Transactional NPS Campaign"
        }
    ]
__________________________________________________________________

LIST AVAILABLE TAGS

Example URI: GET https://app.retently.com/api/v2/nps/tags

a) Parameters (with examples)

    {}

b) Request

    Headers

        Content-Type: application/json

        Authorization: api_key={{api_key}}

    Body

        {}    


c) Response:  200

    [
        {
            "id": "foo",
            "value": "foo"
        },  
        {
            "id": "bar",
            "value": "bar"
        },
        {
            "id": "baz",
            "value": "baz"
        },
     
    ]

__________________________________________________________________

CREATE SUBSCRIBERS & SEND SURVEY

(Works only with Transactional email campaigns. Check our guide on how to run a Transactional campaign using API).

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

a) Parameters (with examples)

  • campaign: 5911d66ee008d0815f747000 (required, string) - The campaign ID from endpoint https://app.retently.com/api/v2/nps/campaigns
  • subscribers: (required, array) - An array of subscribers
  • email: john.smith@example.com (required, string) - Email address
  • first_name: john (optional, string) - First name
  • last_name: smith (optional, string) - Last name
  • company: ACME (optional, string) - Company name
  • tags: ["tag1"] (optional, array) - An array of tags

b) Request

Headers

Content-Type: application/json

Authorization: api_key={{api_key}}

Body

{

   "campaign":"5911d66ee008d0815f747000",
   "subscribers": [

       {

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

           "last_name": "smith",

           "first_name": "jon",                    

           "company": "ACME",           "tags": ["tag1","tag2","tag3"]

       }

    ]

}

c) Response:  200

Headers

Content-Type: application/json

Body

{
    “message”: “Subscribers was successfully added”,
    “code”: 200,
    “data”: {
    "john.smith@example.com”: {
            “status”: “created”,
            “send_status”: “sending”
        }
    }
}

__________________________________________________________________

GET LATEST SCORE

Example URI: GET https://app.retently.com/api/v2/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

 }

}

__________________________________________________________________

GET LATEST RESPONSE  

Example URI: GET https://app.retently.com/api/v2/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         

}

__________________________________________________________________

IMPORTANT!

Retently gives you the possibility to run unlimited API calls. However, we've set a limit of maximum 10 requests per second. This is a needed measure to avoid API calls abuse. If our system detects more than 10 requests per second, then your API calls will be blocked.

The API feature is available starting with the Premium subscription. For more details please check Retently's Pricing page. Thank you!

Did this answer your question?