Overview

‘Emovyz’ is a platform that leverages the power of emojis and transforms engagement with a simple touch. The solution uses a visual survey mechanism also known as an emotion sensor to create the foundation to understand voice of customers, voice of employees and voice of audiences. With this foundation in place, the solution translates into a software-based, emotion survay platform focusing on capturing emotions of the respective target segments, at any given place or time.

To elaborate further, the platform uses an Application Programming Interface (API) set which is HTTP based and follows the essence of REST. The HTTP protocol rules are followed thereby by enabling simple HTTP client tools such as "curl". These insights pave the way for 3rd party software systems to use the data gathered for the purpose of effective decision-making and reach out via embedded emotion surveys in a multitude of mechanisms such as SMS and email – which can be selected based on the target audience’s preference.

The following terminology was created exclusively for the Emovyz platform.


  • Emotion Survey: Emovyz’ visual survey

  • Emoters: Respondents of the survey

  • Emote: Response made by the respective respondent to the visual survey

Description

Emovyz platform offering can be broadly categorized into 3 distinct areas as follows:

  • Visual survey creation - this should be carried out using the WYSIWYG dashboard. Contact your Emovyz business partner or email bizdev@emovyz.com to get access to the Emovyz dashboard.
  • Visual survey sharing - surveys can be made available for the respondents through a multitude of mechanisms including not limited to Email and SMS. Details on these invocations are covered in this API documentation. 3rd party systems such as CRM systems or POS systems can invoke the APIs to share Emovyz visual surveys with respondents.
  • Analyzing survey data and social media data - API documentation provides a comprehensive set of endpoints for developers to make use of Emovyz APIs to integrate Emovyz data with 3rd party platforms.

Getting Started with API Use Cases


Survey Header Details 


  • Get  survey ID for a given Survey name


When you know the Emovyz Survey name you can use /sensors endpoint to get these details.

This is a sample curl command which will retrieve a survey object.

curl -G -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/sensors' --data-urlencode 'sensorName=VOC-Retail'

In the response JSON object there is JSON array field called activities. The first element is the survey object. In the field 'id' give the unique ID of the survey.

{
   "activities":[
      {
         "id":"5aa77a67f0a2440060a66da3",
         "name":"VOC-Retail",
         "title":"Welcome to our store",
         "state":"Active",
         "type":"campaign",
         "startsOn":1520838840000,
         "endsOn":1523603640000,
         "urls":{
            "shortUrl":"sandbox",
            "companyUrl":"demoadmin",
            "sensorUrl":"sandbox"
         },
         "questions":[ Question JSON Objects Array],
         "createdOn":1520926275956,
         "loyaltyFields":["name","email"],
         "companyID":"5aa76ca035c9962bfc3c55d9",
         "companyLogo":"https://storage.emovyz.com/logos/company_logo/5aa76ca035c9962bfc3c55d9.png"
      }
   ],
   "serverTime":1521083552883
}


  • Get all available surveys.


Using the endpoint /sensors you can get all the available surveys.

This is the sample curl command.

curl -G -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/sensors'

In the response JSON object there is a JSON array field called activities. The elements of the array give all the survey configurations.


Survey Meta Details


  • Get  questions of a Survey


When you know the Emovyz Survey Unique key you can use /sensors endpoint to get these details.

This is a sample curl command which will retrieve a survey object.

curl -G -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/sensors?sensorId=5aa77a67f0a2440060a66da3'

In the response JSON object there is JSON array field called activities. The first element is the survey object. In the field questions you can get the list of questions.


                                    
{
   "activities":[
      {
         "id":"5aa77a67f0a2440060a66da3",
         "name":"VOC-Retail",
         "title":"Welcome to our store",
         "state":"Active",
         "type":"campaign",
         "startsOn":1520838840000,
         "endsOn":1523603640000,
         "urls":{
            "shortUrl":"sandbox",
            "companyUrl":"demoadmin",
            "sensorUrl":"sandbox"
         },
         "questions":[
            {
               "inbuilt":false,
               "type":"normal",
               "id":"q1",
               "text":"What was appealing about our sales staff",
               "emoteTheme":{
                  "id":"5aa779757ebe500018dceebc",
                  "themeName":"appealing",
                  "type":"emote",
                  "emoticons":[
                     {
                        "id":"Nothing really",
                        "imgSrc":"ico129",
                        "color":"#fca80b",
                        "url":"https://storage.emovyz.com/pictures/emoticonImages/ico129"
                     },
                     {
                        "id":"Expertise",
                        "imgSrc":"ico146",
                        "color":"#f4f5d1",
                        "url":"https://storage.emovyz.com/pictures/emoticonImages/ico146"
                     },
                     {
                        "id":"Friendliness",
                        "imgSrc":"ico105",
                        "color":"#3158b9",
                        "url":"https://storage.emovyz.com/pictures/emoticonImages/ico105"
                     },
                     {
                        "id":"Helpfulness",
                        "imgSrc":"5aa76ca035c9962bfc3c55d9-ico6",
                        "color":"#b84d48",
                        "imageType":"png",
                        "url":"https://storage.emovyz.com/pictures/emoticonImages/5aa76ca035c9962bfc3c55d9-ico6"
                     },
                     {
                        "id":"First impression",
                        "imgSrc":"ico104",
                        "color":"#e2d4c0",
                        "url":"https://storage.emovyz.com/pictures/emoticonImages/ico104"
                     }
                  ],
                  "demographic":false,
                  "linear":false,
                  "updatedTime":1520925766269,
                  "createdTime":null
               },
               "required":false,
               "multipleChoices":false,
               "enableEmoteOrdering":false,
               "pageNumber":0
            }
         ],
         "createdOn":1520926275956,
         "loyaltyFields":["name","email"] ,
         "companyID":"5aa76ca035c9962bfc3c55d9",
         "companyLogo":"https://storage.emovyz.com/logos/company_logo/5aa76ca035c9962bfc3c55d9.png"
      }
   ],
   "serverTime":1521084079665
}

  • Get  answers of a Survey Question


When you know the Emovyz Survey Unique key you can use /sensors endpoint to get these details.

This is a sample curl command which will retrieve a survey object.

curl -G -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/sensors?sensorId=5aa77a67f0a2440060a66da3'

In the response JSON object there is JSON array field called activities. The first element is the survey object. In the field questions you can get the list of questions. In the question element, there is a field called emoticonTheme. It has the answers for the question.


  • Check loyalty capturing option is enabled


When you know the Emovyz Survey Unique key you can use /sensors endpoint to get these details.

This is a sample curl command which will retrieve a survey object.

curl -G -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/sensors?sensorId=5aa77a67f0a2440060a66da3'

In the response JSON object there is JSON array field called activities. The first element is the survey object. If this object contains loyaltyFields property. That means the loyalty data capturing is enabled. The field value gives a list of loyalty data which will be captured in the survey.

{
   "activities":[
      {
         "id":"5aa77a67f0a2440060a66da3",
         "name":"VOC-Retail",
         "title":"Welcome to our store",
         "state":"Active",
         "type":"campaign",
         "startsOn":1520838840000,
         "endsOn":1523603640000,
         "urls":{
            "shortUrl":"sandbox",
            "companyUrl":"demoadmin",
            "sensorUrl":"sandbox"
         },
         "questions":[ Question JSON Objects Array],
         "createdOn":1520926275956,
         "loyaltyFields":["name","email"],
         "companyID":"5aa76ca035c9962bfc3c55d9",
         "companyLogo":"https://storage.emovyz.com/logos/company_logo/5aa76ca035c9962bfc3c55d9.png"
      }
   ],
   "serverTime":1521083552883
}


Survey Sharing

After you receive a reach out token from Emovyz you can use it to push your surveys from the /messages endpoint. You will have to give the email body content and the SMS text content along with the survey to be used when requesting for the token.


  • Share a survey via email


This is a sample curl command which will share a survey via email.

                                    
                                        

curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d '{"emails":["you@yourdomain.com"],"token":"token-123"}' 'https://api.emovyz.com/api/1.0.0/messages'


  • Share a survey via SMS


This is a sample curl command which will share a survey via SMS.

                                    
                                        

curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d '{"mobileNumbers":["+16506531086"],"token":"token-123"}' 'https://api.emovyz.com/api/1.0.0/messages'


Interaction Based Survey Loading

There are many interactions happening in different different places in big enterprises. Emovyz is supporting sending personalized surveys to people involved in these interactions. Lets take some example interactions in the enterprise,

  • Trainings/Workshops - Set of people conduct trainings/Workshops to other set of people. There are two parties involved in this. Training conductors and participants.
  • Customer Support - Support agents fulfilling requests coming from customers.There are two parties involved in this. Customers and support agent.
  • Technical Support - Technicians helping customers to fulfill technical requests coming to customer support. There are three parties involved in this. Support agent,Technician and customer.
When the our customers identifies these kind of requirements in there enterprise, we can support the process of generating/sending personalized and interaction specific surveys.
The process uses /interactionData endpoint and /interactionBasedSurvey endpoint. Before using these APIs, it needs a interaction processing workflow configuration to be done. That configuration specifies which surveys will be loaded for which party. Also conditional survey loading can be done.

Sample of interaction processing workflow :

This kind of workflows is configured in the Emovyz Dashboard. You can view the workflows in Engage > Interaction Workflow menu. Below digrams shows how these workflows can be used. This can be used in two ways.

  • Manual interaction workflows

Here the Emovyz platform receives enteprise interaction data via /interactionData endpoint. The API client needs to perform another request to/interactionBasedSurvey endpoint to get personalized urls for the interaction.

  • Automatic interaction workflows

In this case also the Emovyz platform receives enteprise interaction data via /interactionData endpoint. But the workflow is configured to execute automatically. That means out platform handles the survey sharing to relevant respondents using Email/SMS. The Email/SMS content is configured using templates in COMM-Center of the Dashboard and attached to workflow.
When one group of respondents complete there survey, workflow execution manager of our APIs intercept those responses and continue the execution of interaction workflow based on the conditions.


Customer Details


  • Get customers in my account.


This data can be fetched through /clientele/loyalty-users api. To retrieve all data you can use the sample request below.

This is a sample curl command which will retrieve all you customer infromation

                                    
                                        

curl -XGET -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID: 5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users'

The response object will give you the total record count. The records retrieved will be paginated. Use pageNumber and pageSize to retrieve rest of the data.


                                    

{
   "recordsTotal":2,
   "recordsFiltered":2,
   "records":[
      {
         "_id":"5aa8e1e8845bb326982eb084",
         "companyID":"5a157f811197676d360c9249",
         "Email":"you@domain.com",
         "lastUpdated":1521122445991,
         "lastUpdatedDate":"2018-03-15T14:00:45.991Z",
         "timeRegistered":1521017320729,
         "userID":"Anonymous1520180578854_72779",
         "activitiesSummary":{
            "lastActivity":1521122547911,
            "lastEmote":"Good",
            "lastActivityID":"5aa3b82f12e538345dccae22",
            "lastPercepticDrillDownID":"q1",
            "5aa3b82f12e538345dccae22":{
               "lastActivity":1521122547911,
               "lastEmote":"Good",
               "q1":{
                  "lastActivity":1521122547911,
                  "lastEmote":"Good",
                  "Good":{
                     "lastActivity":1521122547911,
                     "totalEmotes":1
                  },
                  "totalEmotes":1
               },
               "totalEmotes":1
            },
            "totalEmotes":1
         }
      },
      {
         "_id":"5aaa56dc0e244c166d6fddca",
         "companyID":"5a157f811197676d360c9249",
         "Email":"him@domain.com",
         "lastUpdated":1521121206900,
         "lastUpdatedDate":"2018-03-15T13:40:06.900Z",
         "timeRegistered":1521112796360
      }
   ]
}


  • Details on which surveys the customer has responded.


From the response of any record retrieval it will give you all the activity details of a user in his activitiesSummary field. See sample below.


                                    
{
   "activitiesSummary":{
      "lastActivity":1521122547911,
      "lastEmote":"Good",
      "lastActivityID":"5aa3b82f12e538345dccae22",
      "lastPercepticDrillDownID":"q1",
      "5aa3b82f12e538345dccae22":{
         "lastActivity":1521122547911,
         "lastEmote":"Good",
         "q1":{
            "lastActivity":1521122547911,
            "lastEmote":"Good",
            "Good":{
               "lastActivity":1521122547911,
               "totalEmotes":1
            },
            "totalEmotes":1
         },
         "totalEmotes":1
      },
      "totalEmotes":1
   }
}
}

  • Filter customers on responded number of surveys


To filter using complex queries you can use the /clientele/loyalty-users/_search For the above query you can use the sample request below.

                                    
                                        

curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID: 5aa76ca035c9962bfc3c55d9' -H 'Content-type: application/json' -d '{ "countFilter" : { "type" : "emotedSensorCount", "count" : 1, "operator" : "eq" } }' 'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users/_search'


  • Filter customers on number of responses


To filter using complex queries you can use the /clientele/loyalty-users/_search For the above query you can use the sample request below.

                                    
                                        

curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID: 5aa76ca035c9962bfc3c55d9' -H 'Content-type: application/json' -d '{ "countFilter" : { "type" : "emoteCount", "count" : 1, "operator" : "eq" } }' 'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users/_search'


Survey Response Details   


  • Get the current response status


This can be done from /insights/emotes/type api. It gives a percentage view of responses for the survey.This is the curl command to get the percentage view for question 1.

curl -XGET -H 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8' -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9'
                                        'https://api.emovyz.com/api/1.0.0/insights/emotes/type/5aa77a67f0a2440060a66da3?question=1'

The responses are as shown below,

{

   "activities": {

       "5aa77a67f0a2440060a66da3": {

           "emoteAccumulation": [{

               "emote": "Nothing really",

               "percentage": 25,

               "count": 1,

               "emotag": "#Nothing really",

               "emoteColor": "#fca80b",

               "perceptic": "ico129"

           }, {

               "emote": "Expertise",

               "percentage": 0,

               "count": 0,

               "emotag": "#Expertise",

               "emoteColor": "#f4f5d1",

               "perceptic": "ico146"

           }, {

               "emote": "Friendliness",

               "percentage": 25,

               "count": 1,

               "emotag": "#Friendliness",

               "emoteColor": "#3158b9",

               "perceptic": "ico105"

           }, {

               "emote": "Helpfulness",

               "percentage": 25,

               "count": 1,

               "emotag": "#Helpfulness",

               "emoteColor": "#b84d48",

               "perceptic": "5aa76ca035c9962bfc3c55d9-ico6"

           }, {

               "emote": "First impression",

               "percentage": 25,

               "count": 1,

               "emotag": "#First impression",

               "emoteColor": "#e2d4c0",

               "perceptic": "ico104"

           }],

           "totalCount": 4

       }

   }

}

The emoteAccumulation field of the response gives the percentages of the the responses of question 1.


  • Get location breakdown of survey responses


This data can be fetched from the /insights/emotes/location api. This curl command calls the api to get the location breakdown of question 1 in a survey.

curl -XGET -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H 'companyID:5aa76ca035c9962bfc3c55d9' 'https://api.emovyz.com/api/1.0.0/insights/emotes/location/5aa77a67f0a2440060a66da3?question=1'

The result object gives the location breakdown as follows.


                                    

[{
    "id": "Australia",
    "emotes": [{
        "emote": "Helpfulness",
        "count": 1
    }],
    "total": 1
}, {
    "_id": "United States",
    "emotes": [{
        "emote": "Friendliness",
        "count": 1
    }, {
        "emote": "First impression",
        "count": 1
    }],
    "total": 2
}, {
    "_id": "Sri Lanka",
    "emotes": [{
        "emote": "Nothing really",
        "count": 1
    }],
    "total": 1
}]

API Endpoints Summary

The base URL for the endpoints is as follows:

https://api.emovyz.com/api/1.0.0

API endpoint Description
/templates Retrieving pre-built survey templates.
/templates/survey Creates a survey using survey templates.
/sensors Retrieving survey data.
/surveys Update survey properties.
/surveys/mediaFields Update survey properties which involve binary data such as images, voices and videos.
/interactionData This endpoint is used to submit interaction data.
/interactionBasedSurvey Get the surveys for different interaction stages using interaction configuration and interaction data instance
/insights/emotes/type Returns the emote breakdown by its type.
/insights/emotes/time Returns the emote breakdown by its time.
/insights/emotes/location Returns the emote breakdown by its location.
/insights/emotes/demographics Returns the emote breakdown by its demographics breakdown
/insights/emotes/csi Returns the emote breakdown for a given customer satisfaction index
/insights/emotes/raw Returns the emote array for the given survey
/clientele/loyalty-users Interact with clientele users.
/messages Send messages as SMS or Email.
/insights/social/keyword Get positive/neutral/negative sentiments that are available on Facebook/Twitter/Google+ public posts for a given keyword

OAuth2 Authorization Token Generation

To access the endpoints of Emovyz api, each request should send a OAuth2 token. This API shows the way of obtaining OAuth2 token.

Type - POST

Endpoint- https://api.emovyz.com:8243/token

Description - Returns a OAuth token which need to communicate with the API. Each API call needs to send the access_token returned by this API call in the headers as follows, Authorization : Bearer access_token.

Headers

Content-Type

type : string

required : Yes

sample value - application/x-www-form-urlencoded;charset=UTF-8

Authorization

type : string

required : yes

default : ‘all’

description - Base 64 encoded client id:client secret. Client Id and Client Secret can be found from the Emovyz dashboard profile page.

sample - Basic RWF3VkZheGF6a2E3T0NXU2ZSNWx1Zk5LY3g4YTpmb2F1SGZ5VHdhaTRSejEyX1lfdXZYcDlScjhh

Params

grant_type

type : string query param

required : yes

description - the oauth token generation grant

sample - client_credentials

Result

type : JSON object

description : The result contains a OAuth token which will be valid for a given time period.

This is a sample JSON object return in this endpoint. The token expires in an hour.

                                 
                                     

{

"scope": "am_application_scope default",

"token_type": "Bearer",

"expires_in": 3600,

"access_token": "a0d8054b8a5a37aea4fbc57133b12166"

}

Sample Request -



                                            curl -XPOST -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Basic
                                            RWF3VkZheGF6a2E3T0NXU2ZSNWx1Zk5LY3g4YTpmb2F1SGZ5VHdhaTRSejEyX1lfdXZYcDlScjhh'
                                            'https://api.emovyz.com:8243/token?grant_type=client_credentials'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Basic RWF3VkZheGF6a2E3T0NXU2ZSNWx1Zk5LY3g4YTpmb2F1SGZ5VHdhaTRSejEyX1lfdXZYcDlScjhh'
};

var options = {
    url: 'https://api.emovyz.com:8243/token?grant_type=client_credentials',
    method: 'POST',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Survey Templates

Type - GET

Endpoint- /templates

Description - Returns pre-built survey templates which can be used to create your own survey.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params - none

Return

type : json array

description : This contains template data for each category and categories are sorted by the alphabetical order. Inside each json object there is “templates” fields which is again a json array which contains template details for correspondent category. Each template object has its id , url and screenshot fields which have been discussed below.

Sample json return in this endpoint.

[
  {
    "templates": [
      {
        "screenshot": "test link2",
        "name": "5940d7c49eff5136c81d6729_1499876948056",
        "id": "59664e5408a52b0b5216f7f1",
        "sandboxUrl": "https://emovyz.com/abc"
      },
      {
        "screenshot": "test link2",
        "name": "test321321",
        "id": "59f6ad4e0bf088139dd778ee",
        "sandboxUrl": "https://emovyz.com/test"
      },
      {
        "screenshot": "test link2",
        "name": "location survey",
        "id": "5ad6ccb3ab6b43000c73fca2",
        "sandboxUrl": "https://emovyz.com/locations"
      }
    ],
    "category": "Hospitality"
  },
  {
    "templates": [
      {
        "screenshot": "test link2",
        "name": "eventt",
        "id": "59fae9302fe50f67fb45b2b7",
        "sandboxUrl": "https://emovyz.com/eve"
      },
      {
        "screenshot": "test link2",
        "name": "feedback camp",
        "id": "597b63c428bea8349090f91b",
        "sandboxUrl": "https:/emovyz.com/fbc"
      }
    ],
    "category": "community"
  },
  {
    "templates": [
      {
        "screenshot": "test link2",
        "name": "campaign mail msg",
        "id": "596e2d57309326625d0144af",
        "sandboxUrl": "https://emovyz.com/emm1"
      }
    ],
    "category": "Tourism"
  },
  {
    "templates": [
      {
        "screenshot": "test link2",
        "name": "test sms",
        "id": "5acc89aa5268b6000bf31f57",
        "sandboxUrl": "https://emovyz.com/sms"
      }
    ],
    "category": "sms"
  }
]

id - this identifier for a given template is used when create a new survey in your own account.

name - template name which describes the survey context shortly.

sandboxUrl - this is the sandbox url for the survey where you can access the survey and feel how it works.

screenshot - this is the link to an image which contains the screenshot of the first page of the survey which can be used as a thumbnail.

Sample Request - Get Templates



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/templates'
                                        

                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/templates',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Survey Create Using Templates

Type - POST

Endpoint- /templates/survey

Description - creates a survey using survey templates discussed in the above endpoint.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

templateId

type : string

required : Yes

description - template id of your choice which is used to create the new survey. This id can be retrieved from templates GET endpoint which has discussed earlier.

sample - 59e4d1d10c4e840499e31401

name

type : string

required : Yes

maximum characters : 100

description - You have to give your own name for the new survey you are creating. This cannot be duplicated with the name of already created survey.

sample - “My Survey”

urlSuffix

type : string (alphanumeric)

required : No

description - You can specify the desired url suffix to access the survey which is an alphanumeric string. If specified the survey can be accessed through an URL of the form of www.emovyz.com/urlSuffix. If the url suffix you specified is already taken then it will be communicated in the return message. If you do not specify this field Emovyz will generate its own url and return back to you.

sample - “mysurvey”

Return

type : json object

description : A json object returns of the following format.

Sample json return in this endpoint.

{
  "message": "survey created success",
  "surveyId": "5ad81edc81176d32ac808b72",
  "surveyUrl": "https://emovyz.com/mysensor1"
}

message - this fields contains a message describing the status of the survey creation. If the input is not valid or duplicate name or short url is given that will be communicated in this field.

surveyId - if creation is a success this contains a unique id for the survey which can be used to Retrieve, update, delete or get analytics in later stages.

surveyUrl - this can be used to access created survey. As discussed above this is either derived from “urlSuffix” field or auto generated if “urlSuffix” is not specified in the request.

Sample Request - Create Survey From Templates


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{
	"templateId":"5acedaf67da6c6000a250f90",
	"name":"My Survey",
	"urlSuffix":"msurvey"
}'
                                            'https://api.emovyz.com/api/1.0.0/templates/survey'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{ "templateId":"5acedaf67da6c6000a250f90", "name":"My Survey", "urlSuffix":"msurvey" }';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/templates/survey',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Survey

Type - GET

Endpoint- /sensors

Description - Returns the survey configuration data.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

sensorId

type : string

required : No

description - The unique id of the survey

sample - 5aa77a67f0a2440060a66da3

sensorName

type : string

required : No

description - The unique name of the survey

sample - “My Survey”

Return

type : json object

description : A json object is returned with “activities” field which is a json array. Each array element contains metadata related to your survey. The metadata fields of a survey are described below.

Sample json object return in this endpoint.

{
  "activities": [
    {
      "id": "5aa77a67f0a2440060a66da3",
      "name": "VOC-Retail",
      "title": "Welcome to our store",
      "state": "Active",
      "type": "campaign",
      "startsOn": 1520838840000,
      "endsOn": 1523603640000,
      "urls": {
        "shortUrl": "sandbox",
        "companyUrl": "demoadmin",
        "sensorUrl": "sandbox"
      },
      "questions": [

      ],
      "createdOn": 1521086086387,
      "loyaltyFields": [
        {
          "field": "Name",
          "fieldID": "Name",
          "unique": false,
          "type": "text",
          "default": true
        },
        {
          "field": "Email",
          "fieldID": "Email",
          "unique": true,
          "type": "text",
          "default": true
        }
      ],
      "companyID": "5aa76ca035c9962bfc3c55d9",
      "companyLogo": "https:\/\/storage.emovyz.com\/logos\/company_logo\/5aa76ca035c9962bfc3c55d9.png"
    }
  ],
  "serverTime": 1521107790079
}

id - unique survey id

name - unique survey name

title - A descriptive title for the survey. This is an optional field

state - The state of the survey which is specified by orchestrator.

type - whether the survey is of campaign or event type. A campaign can have multiple pages and submit all selected responses at one time. An event has only one page and each response of questions submits independently.

endsOn - The epoch timestamp of survey end time. If the current time passes this, the survey is considered as an expired.

urls - this is a json object which contains url components to access the survey. The url components are,

      shortUrl - Optional short url of a survey. If this is specified the survey can be accessed from www.emovyz.com/<shortUrl>

      companyUrl and sensorUrl - These are mandatory fields on a survey. Any survey can be accessed from www.emovyz.com/<companyUrl>/<sensorUrl>

questions - A json array which represents the questions of a survey. Each question object contains following fields;

id - question id.

text  - descriptive question

emoteTheme - A json object which contains the responses for the question. It has a field “emoticons” which is a json array. Sample json object of emoticons array is given below.

{

"id": "Happy",

"color": "#221310",

"url": "https://storage.emovyz.com/pictures/emoticonImages/59747e53cd90e9231b90de48-ico8"

 

}

Following are the descriptions for each field on emoticons object

id -  contains the response text.

color - color which used to represent the response

url - url of the emoji to represent the response.

 

required - whether a required or optional question

multipleChoices - If true the user can select multiple responses for that question

enableEmoteOrdering - If true the user can select multiple responses and rank those.

 

loyaltyFields - enabled loyalty data fields of a survey.

createdOn - The Epoch time of survey created

Sample Request - Get Survey By its unique identifier



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/sensors?sensorId=5aa77a67f0a2440060a66da3'
                                        

                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/sensors?sensorId=5aa77a67f0a2440060a66da3',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Sample Request - Get Survey By its name



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/sensors?sensorName=VOC-Retail'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/sensors?sensorName=VOC-Retail',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Sample Request - Get All Available Surveys



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/sensors'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/sensors',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Update Surveys

Type - PUT

Endpoint- /surveys

Description - update survey properties.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

id

type : string

required : Yes

description - survey id to update.

sample - 59e4d1d10c4e840499e31401

survey

type : json object

required : No

description - This object contains the general survey properties to be updated. Below is the list of supported properties.

name

description : a short name to identify the survey. Cannot be duplicated. Name will be displayed in the survey header if title is not defined.

type : string

Maximum characters : 100

title

description : more descriptive text to describe the survey. This will be displayed on survey header area

type : string

Maximum characters : 400

logo

description : public url of an image to be displayed on top left corner of the survey which will help to whitelabel the survey. The url should point to a PNG or JPEG image and the size should be less than 100KB.

sample : https://myimages.com/mylogo.png

skin

type : json object

required : No

description - This object contains the properties of survey which can be used to change its look and feel. Currently this supports “background” property. That can be used to alter survey background by defining a public image url.

The url should point to a PNG or JPEG image and the size should be less than 200KB.

sample : "background" : { "image" : "https://myimages.com/mybackground.png" }

Return

type : json object

description : A json object is returned with “message” field which contains the status of the api call.

Sample json return in this endpoint.

{
  "message": "survey updated success",
  "surveyId": "5aeadaa557974352c85187ba",
  "surveyUrl": "https://emovyz.com/samplesurvey"
}

Sample Request - Update Survey


                                            curl -XPUT -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{
	"id": "5aa77a67f0a2440060a66da3",
	"survey": {
		"name": "Sensor ASLG 5",
		"title": "Sensor ASLG 5",
		"logo": "https://1gr.cz/fotky/idnes/15/073/cl5/MLA5cbd6a_dscovr_earth.jpg"
	},
	"skin": {
		"background": {
			"image": "https://1gr.cz/fotky/idnes/15/073/cl5/MLA5cbd6a_dscovr_earth.jpg"
		}
	}
}'
                                            'https://api.emovyz.com/api/1.0.0/surveys'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{ "id": "5aa77a67f0a2440060a66da3", "survey": { "name": "Sensor ASLG 5", "title": "Sensor ASLG 5", "logo": "https://1gr.cz/fotky/idnes/15/073/cl5/MLA5cbd6a_dscovr_earth.jpg" }, "skin": { "background": { "image": "https://1gr.cz/fotky/idnes/15/073/cl5/MLA5cbd6a_dscovr_earth.jpg" } } }';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/surveys',
    method: 'PUT',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Update Survey Media Fields

Type - PUT

Endpoint- /surveys/mediaFields

Content Type- multipart/form-data

Description - update survey properties which involve binary data such as images, voices and videos.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

id

type : string

required : Yes

description - survey id to update.

sample - 59e4d1d10c4e840499e31401

files

type : multipart

required : at least one file is required

description - This contains all media data in the survey. The supported media file types are given below

logo

description : The logo file contains image data which is to be displayed on top left corner of the survey which will help to whitelabel the survey. This image should be a PNG or JPEG image and the size should be less than 100KB.

background

description : This file contains image data to display as survey background. This image should be a PNG or JPEG image and the size should be less than 200KB.

Return

type : json object

description : A json object is returned with “message” field which contains the status of the api call.

Sample json return in this endpoint.

{
  "message": "survey updated success",
  "surveyId": "5aeadaa557974352c85187ba",
  "surveyUrl": "https://emovyz.com/samplesurvey"
}

Sample Request - Update Survey Media


                                            curl -XPUT -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: multipart/form-data" -F "id=5aa77a67f0a2440060a66da3"
                                            -F "logo=@/home/Pictures/audi.jpg" -F "background=@/home/Pictures/audi.jpg"
                                            'https://api.emovyz.com/api/1.0.0/surveys'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'multipart/form-data'
};


var options = {
    url: 'https://api.emovyz.com/api/1.0.0/surveys',
    method: 'PUT',
    headers: headers,
    formData : { "id" : "5aa77a67f0a2440060a66da3",
    "logo" : fs.createReadStream("./images/scr1.jpg"),
    "background" : fs.createReadStream("./images/scr1.jpg")
    }
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Submit Interaction Data to Emovyz Platform

Type - POST

Endpoint- /interactionData

Description - This endpoint is used to submit interaction data.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

interactionWorkflowID

type : string

required : Yes

description - The unique interaction processing configuration id

sample - 59e4d1d10c4e840499e31401

interactionID

type : string

required : No

description - A unique interaction ID. Uniquness of this need to be considered

sample - 12345678

interactionDetails

type : JSON Array

required : Yes

description - A JSON array which will describe the interactions in the interaction and its relationship with the actual users

sample :

[
   {
      "stage":0,
      "users":[
         {
            "name":"Sample User1",
            "email":"111@xyz.com",
            "telephone":"+94777111111",
            "userID":"59e4d1d10c4e840499e31401"
         },
         {
            "name":"Sample User2",
            "email":"222@xyz.com",
            "telephone":"+94777222222",
            "userID":"59e4d1d10c4e840499e31402"
         }
      ]
   },
   {
      "stage":1,
      "users":[
         {
            "name":"Sample User3",
            "email":"333@xyz.com",
            "telephone":"+94777333333",
            "userID":"59e4d1d10c4e840499e31403"
         },
         {
            "name":"Sample User4",
            "email":"444@xyz.com",
            "telephone":"+94777444444",
            "userID":"59e4d1d10c4e840499e31404"
         }
      ]
   }
]
                            

metadata

type : JSON Object

required : No

description - Set of metadata objects to identify the scneario

sample :

{"name":"Customers acknowledging the job","city":"Colombo 4"}
                            

Return

type : json object

description : JSON object with unique ID for the interaction data. This unique id is needed for other API calls.

Sample json return in this endpoint.

{
  interactionID : “12345678”
}

Sample Request - Submit Interaction Data


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{
  "interactionWorkflowID": "5c07a0782682120cf9496224",
  "interactionID":"12345679999",
  "interactionDetails": [
    {
      "stage": 0,
      "users": [
        {
          "Name": "Installer Ten",
          "Email": "installer10@emojot.com",
          "Telephone": "+94777101010"
        }
      ]
    },
    {
      "stage": 1,
      "users": [
        {
          "Name": "Customer Eleven",
          "Email": "customer11@emojot.com",
          "Telephone": "+94777111111"
        }
      ]
    }
  ],
  "metadata": {
    "name": "TV Installation Job 8",
    "jobID": "12345678"
  }
}'
                                            'https://api.emovyz.com/api/1.0.0/interactionData'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{ "interactionWorkflowID": "5c07a0782682120cf9496224", "interactionID":"12345679999", "interactionDetails": [ { "stage": 0, "users": [ { "Name": "Installer Ten", "Email": "installer10@emojot.com", "Telephone": "+94777101010" } ] }, { "stage": 1, "users": [ { "Name": "Customer Eleven", "Email": "customer11@emojot.com", "Telephone": "+94777111111" } ] } ], "metadata": { "name": "TV Installation Job 8", "jobID": "12345678" } }';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/interactionData',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Get InterBased Surveys URL for Given Interaction

Type - GET

Endpoint- /interactionBasedSurvey

Description - Get the surveys for different interaction stages using interaction configuration and interaction data instance

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

interactionWorkflowID

type : string

required : Yes

description - The unique interaction processing configuration id

sample - 59e4d1d10c4e840499e31401

interactionID

type : string

required : Yes

description - The unique interaction id

sample : 12345678

customInteractionID

type : Boolean

required : No

description - Whether the interaction is created using custom ID

sample : true

Return

type : JSON object

description : JSON object with survey Urls

Response for the two staged interaction with second stage has emoting conditions to generate user survey urls

{
   "interactionID":"12345679999",
   "userSurveys":[
      {
         "stage":0,
         "users":[
            {
               "Name":"Installer Ten",
               "Email":"installer10@emojot.com",
               "Telephone":"+94777101010",
               "companyID":"5a157f811197676d360c9249",
               "sensorURL":"http://dev.emojot.com/installerSurvey?interactionID=12345679999&interactionStage=0&emotingToken=154408199613816104586&userVisibleName=installer10@emojot.com"
            }
         ]
      },
      {
         "stage":1,
         "users":[
            {
               "Name":"Customer Eleven",
               "Email":"customer11@emojot.com",
               "Telephone":"+94777111111",
               "companyID":"5a157f811197676d360c9249",
               "sensorURL":"Pending"
            }
         ]
      }
   ]
}
                            

In this response you can see that stage 0 user list only has surveyURL. That because the stage 1 users survey url will be decided base don the response of stage 0 users. That conditions are configured in the workflow configuration.

As soon as the the stage 0 users has completed the survey, when you perform another request to this same endpoint, that stage 1 users will have survey urls generated.

Sample Request - Get interaction based surveys url given interaction


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/interactionBasedSurvey?interactionID= 123456789&customInteractionID=true&interactionWorkflowID=5c07a0782682120cf9496224'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/interactionBasedSurvey?interactionID= 123456789&customInteractionID=true&interactionWorkflowID=5c07a0782682120cf9496224',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Type

Type - GET

Endpoint- /insights/emotes/type/<sensorId>

Description - returns the survey responses breakdown by its type.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params

question

type : string

required : Yes

description - id of the question for which the emote breakdown is calculated. This id can be obtained from survey get endpoint. See question field of survey object.

sample - q211, q432, q2 etc.

emoteSeries

type : string

required : no

default : ‘all’

description -whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

extremes

type : json object

required : no

default : -

description - json object with representing time period filters. Consists of min and max fields.

sample -


                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

location

type : json object

required : no

description -json object representing the location filters. There are two fields for the location filter; type and location. Type represents whether the location is a point or an area. Location represents the geo fence for the filter which is an array of geo points. A single geo point is a two element array where first element represents the longitude and second represents the latitude.

sample - “area” type filter


                                    

{

type : “area”,

coordinates : [

[79.1,6.1],

[79.2,6.2],

[79.3,6.3],

[79.4,6.4]

]

}

“point” type filter is deprecated.

Return

type : json object

description : A json object is returned with emote breakdown. Emote breakdown can be accessed from “emoteAccumulation” field.

emoteAccumulation field contains a json array in which each element represents an emoji.

sample - sample json object return in this endpoint.

{
  "activities": {
    "5aa77a67f0a2440060a66da3": {
      "emoteAccumulation": [
        {
          "emote": "Nothing really",
          "percentage": 25,
          "count": 1,
          "emotag": "#Nothing really",
          "emoteColor": "#fca80b",
          "perceptic": "ico129"
        },
        {
          "emote": "Expertise",
          "percentage": 0,
          "count": 0,
          "emotag": "#Expertise",
          "emoteColor": "#f4f5d1",
          "perceptic": "ico146"
        },
        {
          "emote": "Friendliness",
          "percentage": 25,
          "count": 1,
          "emotag": "#Friendliness",
          "emoteColor": "#3158b9",
          "perceptic": "ico105"
        },
        {
          "emote": "Helpfulness",
          "percentage": 25,
          "count": 1,
          "emotag": "#Helpfulness",
          "emoteColor": "#b84d48",
          "perceptic": "5aa76ca035c9962bfc3c55d9-ico6"
        },
        {
          "emote": "First impression",
          "percentage": 25,
          "count": 1,
          "emotag": "#First impression",
          "emoteColor": "#e2d4c0",
          "perceptic": "ico104"
        }
      ],
      "totalCount": 4
    }
  }
}

Sample Request - Get survey responses breakdown by its type


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/type/5aa77a67f0a2440060a66da3?question=1'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/type/5aa77a67f0a2440060a66da3?question=1',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Time

Endpoint - /insights/emotes/time/<sensorId>

Type - GET

Description - returns the emote breakdown by time. Can be aggregated for daily or monthly

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

question

type : string

required : Yes

description - id of the question for which the emote breakdown is calculated. This id can be obtained from survey get endpoint. See question field of survey object.

sample - q211, q432, q2 etc.

emoteSeries

type : string

required : no

default : ‘all’

description - whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

extremes

type : json object

required : no

description - json object with representing time period filters. Consists of min and max fields.

sample -


                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

Location

type : json object

required : no

description - json object representing the location filters. There are two fields for the location filter; type and location. Type represents whether the location is a point or an area. Location represents the geo fence for the filter which is an array of geo points. A single geo point is a two element array where first element represents the longitude and second represents the latitude.

sample - “area” type filter


                                    

{

type : “area”,

coordinates : [

[79.1,6.1],

[79.2,6.2],

[79.3,6.3],

[79.4,6.4]

]

}

“point” type filter is deprecated.

period

type : string

required : no

default : - monthly

description - the time period of aggregation.

sample - daily/monthly

Return

type : json object

description : This json object contains a field, “emoteAccumulation” which is a json array, in which each element represents an emoji.

sample - sample json object return in this endpoint.

{
  "emoteAccumulation": [
    {
      "emote": "Nothing really",
      "timeBasedAccumulation": [
        [
          [
            2018,
            2
          ],
          1
        ]
      ],
      "color": "#fca80b"
    },
    {
      "emote": "Expertise",
      "timeBasedAccumulation": [

      ],
      "color": "#f4f5d1"
    },
    {
      "emote": "Friendliness",
      "timeBasedAccumulation": [
        [
          [
            2018,
            2
          ],
          1
        ]
      ],
      "color": "#3158b9"
    },
    {
      "emote": "Helpfulness",
      "timeBasedAccumulation": [
        [
          [
            2018,
            2
          ],
          1
        ]
      ],
      "color": "#b84d48"
    },
    {
      "emote": "First impression",
      "timeBasedAccumulation": [
        [
          [
            2018,
            2
          ],
          1
        ]
      ],
      "color": "#e2d4c0"
    }
  ],
  "ecoSigs": [

  ]
}

Sample Request - Get survey responses breakdown by time


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/time/5aa77a67f0a2440060a66da3?question=1'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/time/5aa77a67f0a2440060a66da3?question=1',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Location

/insights/emotes/location/<sensorId>

Type - GET

Description - returns the emote breakdown by location. The granularities provided are country and city

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

Question

type : string

required : Yes

description - id of the question for which the emote breakdown is calculated. This id can be obtained from survey get endpoint. See question field of survey object.

sample - q211, q432, q2 etc.

scope

type : string

required : no

default : - ‘country’

description - the granularity of analysis

sample - country/city

emoteSeries

type : string

required : no

default : ‘all’

description -whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

extremes

type : json object

required : no

description -json object with representing time period filters. Consists of min and max fields.

sample -



                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

Return

type : json array

description : each element represent either a country or city. Following sample shows an element of country breakdown

sample -

[
  {
    "_id": "Australia",
    "emotes": [
      {
        "emote": "Helpfulness",
        "count": 1
      }
    ],
    "total": 1
  },
  {
    "_id": "United States",
    "emotes": [
      {
        "emote": "Friendliness",
        "count": 1
      },
      {
        "emote": "First impression",
        "count": 1
      }
    ],
    "total": 2
  },
  {
    "_id": "Sri Lanka",
    "emotes": [
      {
        "emote": "Nothing really",
        "count": 1
      }
    ],
    "total": 1
  }
]

Sample Request - Get survey responses breakdown by location


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/location/5aa77a67f0a2440060a66da3?question=1'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/location/5aa77a67f0a2440060a66da3?question=1',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Demographics

/insights/emotes/demographics/<sensorId>

Type - GET

Description - returns the emote breakdown for the demographics. The survey should have atleast one demographic type question enabled to retrieve these analytics.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

Question

type : string

required : Yes

description - id of the question for which the emote breakdown is calculated. This id can be obtained from survey get endpoint. See question field of survey object.

sample - q211, q432, q2 etc.

demographic

type : string

required : yes

description - id of one of the demographic questions added in the survey.

sample - q432, q231 where each of these questions are of demographics type.

 

emoteSeries

type : string

required : no

default : ‘all’

description - whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

extremes

type : json object

required : no

description - json object representing time period filters. Consists of min and max fields.

sample -



                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

location

type : json object

required : no

description - json object representing the location filters. There are two fields for the location filter; type and location. Type represents whether the location is a point or an area. Location represents the geo fence for the filter which is an array of geo points. A single geo point is a two element array where first element represents the longitude and second represents the latitude.

sample - “area” type filter


                                    

{

type : “area”,

coordinates : [

[79.1,6.1],

[79.2,6.2],

[79.3,6.3],

[79.4,6.4]

]

}

“point” type filter is deprecated.

Return

type : json object

description : This json object contains a field, “result” which is a json object, and which consists of demographic fields and the breakdown for those demographics for each emote response

sample -

{
  "response": true,
  "details": "Success",
  "result": {
    "analysis": [
      {
        "name": "Nothing really",
        "color": "#fca80b",
        "data": [
          0,
          0,
          0
        ]
      },
      {
        "name": "Expertise",
        "color": "#f4f5d1",
        "data": [
          0,
          0,
          0
        ]
      },
      {
        "name": "Friendliness",
        "color": "#3158b9",
        "data": [
          0,
          0,
          0
        ]
      },
      {
        "name": "Helpfulness",
        "color": "#b84d48",
        "data": [
          0,
          0,
          0
        ]
      },
      {
        "name": "First impression",
        "color": "#e2d4c0",
        "data": [
          0,
          0,
          0
        ]
      }
    ],
    "demographics": [
      {
        "id": "Other",
        "imgSrc": "ico93",
        "color": "#fe944d"
      },
      {
        "id": "Female",
        "imgSrc": "ico90",
        "color": "#ea3900"
      },
      {
        "id": "Male",
        "imgSrc": "ico91",
        "color": "#a3bae0"
      }
    ]
  }
}

       Data array elements are in the order of demographics array elements, i.e. nth element in the data array corresponds to the nth element in demographics array.

Sample Request - Get survey responses breakdown by demographics


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/demographics/5aa77a67f0a2440060a66da3?question=1&demographic=4'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/demographics/5aa77a67f0a2440060a66da3?question=1&demographic=4',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Customer Satisfaction Index

/insights/emotes/csi/<senorId>

Type - GET

Description - returns the customer satisfaction index scores and its time based breakdown.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

question

type : string

required : Yes

description - the id of the question for which the emote breakdown is calculated. This id can be obtained from survey get endpoint. See question field of survey object. This question has to be of customer satisfaction index type; i.e nps, csat, ces type 1 or ces type 2

sample - q211,q432,q2 etc.

 

emoteSeries

type : string

required : no

default : ‘all’

description -whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

period

type : string

required : no

default : - ‘monthly’

description - the time period of aggregation.

sample - daily/monthly

extremes

type : json object

required : no

description -json object with representing time period filters. Consists of min and max fields.

sample -


                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

location

type : json object

           required : no

           description -json object representing the location filters. There are two fields for the location filter; type and location. Type represents whether the location is a point or an area. Location represents the geo fence for the filter which is an array of geo points. A single geo point is a two element array where first element represents the longitude and second represents the latitude.

sample - “area” type filter


                                    

{

type : “area”,

coordinates : [

[79.1,6.1],

[79.2,6.2],

[79.3,6.3],

[79.4,6.4]

]

}

“point” type filter is deprecated.

Return -

type : json object

description : This json object contains a field, “breakdown” which is a json array, representing daily or monthly breakdown values. The “currentVal” field contains the overall Customer Satisfaction Index socre.

sample -

{
  "response": true,
  "currentVal": "-25.00",
  "breakDowns": [
    {
      "date": {
        "year": 2018,
        "month": 3
      },
      "val": -25
    }
  ]
}

Sample Request - Get survey responses CSI values


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/csi/5aa77a67f0a2440060a66da3?question=3'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/csi/5aa77a67f0a2440060a66da3?question=3',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Raw

/insights/emotes/raw/sensorId

Type - GET

Description - returns the emote array for the given survey.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

question

type : string

required : No

description - id of the question for which the raw emotes retrieved. This id can be obtained from survey get endpoint. See question field of survey object. If question is not defined it will return emotes for all the questions.

sample - q211,q432,q2 etc.

 

emoteSeries

type : string

required : no

default : ‘all’

description -whether to consider the first emote series or last emote series or all emotes of the crowd.

Allowed Values -first,last,all

extremes

type : json object

required : no

description -json object with representing time period filters. Consists of min and max fields.

sample -


                                    

{

min: Epoch time for start time,

max: Epoch time for start time

}

location

type : json object

required : no

description - json object representing the location filters. There are two fields for the location filter; type and location. Type represents whether the location is a point or an area. Location represents the geo fence for the filter which is an array of geo points. A single geo point is a two element array where first element represents the longitude and second represents the latitude.

sample - “area” type filter


                                    

{

type : “area”,

coordinates : [

[79.1,6.1],

[79.2,6.2],

[79.3,6.3],

[79.4,6.4]

]

}

“point” type filter is deprecated.

Return

type : json array

description : returns emotes as a json array. Each json object has“metadata” fields which contains location metadata. It includes country and city of the emote. Also It has “emoterMetaData” field which contains the device information of user.

The emotes are contained in “emotes” field. It has “obj” field which contains an json object. Each key of the json object corresponds to a question.

Each question key points to a json array. If it is a single select question only one element will be there in each json object of that array.

If it is a multi select question multiple elements along with order param will be there in each json object.

sample -

[
  {
    "_id": "5aa77fc57ebe500018dcef25",
    "userID": "Anonymous1518126371061816280",
    "userVisibleName": "Anonymous",
    "metadata": {
      "location": {
        "locality": "N\/A",
        "country": "Australia"
      },
      "emoterMetaData": {
        "browser": "Chrome",
        "os": "Mac OS X"
      }
    },
    "timeStamp": 1520926660060,
    "emotes": {
      "obj": {
        "q1": [
          {
            "emote": "Helpfulness"
          }
        ]
      }
    }
  },
  {
    "_id": "5aa7c9a89e1fe20030c8fe1a",
    "userID": "Anonymous1519229306013_675174",
    "userVisibleName": "Anonymous",
    "metadata": {
      "location": {
        "locality": "Fremont",
        "country": "United States"
      },
      "emoterMetaData": {
        "browser": "Mobile",
        "os": "iOS"
      }
    },
    "timeStamp": 1520945576008,
    "emotes": {
      "obj": {
        "q1": [
          {
            "emote": "First impression"
          }
        ]
      }
    }
  },
  {
    "_id": "5aa7d1e1b8cb270084827c7a",
    "userID": "Anonymous1519362942570_823129",
    "userVisibleName": "Anonymous",
    "metadata": {
      "location": {
        "locality": "Mountain View",
        "country": "United States"
      },
      "emoterMetaData": {
        "browser": "Chrome",
        "os": "Mac OS X"
      }
    },
    "timeStamp": 1520947681160,
    "emotes": {
      "obj": {
        "q1": [
          {
            "emote": "Friendliness"
          }
        ]
      }
    }
  },
  {
    "_id": "5aa96ff2c05b270019f73442",
    "userID": "Anonymous1519801819065_825459",
    "userVisibleName": "Anonymous",
    "metadata": {
      "location": {
        "locality": "Kadawatha",
        "country": "Sri Lanka"
      },
      "emoterMetaData": {
        "browser": "Chrome",
        "os": "Mac OS X"
      }
    },
    "timeStamp": 1521053681341,
    "emotes": {
      "obj": {
        "q1": [
          {
            "emote": "Nothing really"
          }
        ]
      }
    }
  }
]

Sample Request - Get survey raw responses


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/emotes/raw/5aa77a67f0a2440060a66da3?question=1'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/emotes/raw/5aa77a67f0a2440060a66da3?question=1',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Customers

/clientele/loyalty-users

Type - GET

Description - Returns all clientele records of your company or a record identified by a unique field.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

uniqueField

type : string

required : true (if single record request)

description - unique field that identify the user.

Allowed Values - email,telephone

value

type : string

required : true (if single record request)

description unique field value that identify the user.

pageSize

type : integer

required : no

description -used for setting the record limit for the request. A 0 value will mean send all documents. Default is 100.

pageNumber

type : integer

required : no

description - jused for setting the starting position when doing a paginated request. Numbering starts from 0

draw

type : string

required : no

description - will be sent back with response. Can be used to identify the request that initiated the call

Return

type : json object

sample -


                                

{
   "recordsTotal":185,
   "draw":"1",
   "recordsFiltered":185,
   "records":[
      {
         "_id":"5a8d593530bb210e3f6e6314",
         "companyID":"5aa76ca035c9962bfc3c55d9",
         "Name":"User Name"
      },
   ]
}

Sample Request - Get all loyalty customer details


                                            curl -XGET -H 'Content-Type:
                                            application/x-www-form-urlencoded;charset=UTF-8' -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users'
                                        


                                            

var request = require('request');

var headers = {
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users',
    method: 'GET',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);


Advanced Queries

/clientele/loyalty-users/_search

Type - POST

Description - Returns clientele record specified by the id

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

filterName

type : string

required : No

description - Reuse existing filters saved at clientele report.

search

type : string

required : No

description The string sent will be matched against all string fields of the user record except record ID and userID. The sent string will be considered to be case insensitive.

emotedSensors

type : string Array

required : no

description -retrieve all users who emoted to the specified survey list.

countFilter

type : JSON Object

required : No

description - Retrieve users on total emotes or the number of surveys emoted to.

sample-


                                    
{
   type:   emoteCount 
   count
:5,
   operator:gt
}

type : can be one of emoteCount or emotedSensorCount

value : the value compared with

operator : the operation which could be either of gt, lt, eq

pageSize

type : integer

required : no

description -used for setting the record limit for the request. A 0 value will mean send all documents. Default is 100.

pageNumber

type : integer

required : no

description - used for setting the starting position when doing a paginated request. Numbering starts from 0

draw

type : string

required : no

description - will be sent back with response. Can be used to identify the request that initiated the call

Return

type : json object

sample -

{
  "recordsTotal": 16,
  "recordsFiltered": 1,
  "records": [
    {
      "_id": "5aab4379302b1c000be7ea54",
      "companyID": "5aa76ca035c9962bfc3c55d9",
      "Email": "andun@emojot.com",
      "userID": "Anonymous1496724723145_716400",
      "lastUpdated": 1521173369869,
      "lastUpdatedDate": "2018-03-16T04:09:29.869Z",
      "timeRegistered": 1521173369891,
      "activitiesSummary": {
        "lastActivity": 1521173385194,
        "lastEmote": "Male",
        "lastActivityID": "5aa77a67f0a2440060a66da3",
        "lastPercepticDrillDownID": "q4",
        "5aa77a67f0a2440060a66da3": {
          "lastActivity": 1521173385194,
          "lastEmote": "Male",
          "q1": {
            "lastActivity": 1521173385194,
            "lastEmote": "Friendliness",
            "Friendliness": {
              "lastActivity": 1521173385194
            }
          },
          "totalEmotes": 5,
          "q2": {
            "totalEmotes": 1,
            "Agree": {
              "totalEmotes": 1,
              "lastActivity": 1521173385194
            },
            "lastActivity": 1521173385194,
            "lastEmote": "Agree"
          },
          "q6": {
            "lastActivity": 1521173385194,
            "lastEmote": "Satisfied",
            "Satisfied": {
              "lastActivity": 1521173385194,
              "totalEmotes": 1
            },
            "totalEmotes": 1
          },
          "q3": {
            "8": {
              "lastActivity": 1521173385194,
              "totalEmotes": 1
            },
            "lastActivity": 1521173385194,
            "lastEmote": "8",
            "totalEmotes": 1
          },
          "q5": {
            "totalEmotes": 1,
            "Silent": {
              "totalEmotes": 1,
              "lastActivity": 1521173385194
            },
            "lastActivity": 1521173385194,
            "lastEmote": "Silent"
          },
          "q4": {
            "lastActivity": 1521173385194,
            "lastEmote": "Male",
            "Male": {
              "lastActivity": 1521173385194,
              "totalEmotes": 1
            },
            "totalEmotes": 1
          }
        },
        "totalEmotes": 5
      }
    }
  ]
}

Sample Request - Search user by keyword


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{"search" : "andun"}'
                                            'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users/_search'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{"search" : "andun"}';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/clientele/loyalty-users/_search',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Messages

/messages

Type - POST

Description - send messages as SMS or Email.

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

token

type : string

required : Yes (If you are accessing the API to push using a reachout token)

description - Use the given reachout token to send messages through the API. This will use the predefined Email/SMS details bound to the token.

emails

type : string array

required : Yes (If you are sending Emails)

description The receiver emails as an Array. Cannot be sent with mobileNumbers

sample : [ you@yourdomain.com, person@yourdomain.com ]

emailData

type : JSON Object

required : no

description -The email subject, from and fromName definition.

sample -


                                
{
   "subject":"Hi User",
   "from":"you@yourdomain.com",
   "fromName":"yourname"
}

campaignName

type : String

required : no

description - Name to identify your email campaign

mobileNumbers

type : string

required : Yes (if you are sending SMS)

description - The receiver mobile numbers as an Array. The numbers should be in e164 format. Cannot be sent with emails

sample : [ “+94XXXXXXXXX” , “+1XXXXXXXXX” ]

content

type : string

required : Yes

description - The message body. Not required if template or reachout token is used

templateName

type : string

required : Yes

description - Template to be used when sending out the message. Email templates can be created at clienteling portal. SMS templates can be requested by the emovyz team. Not required if using content or reachout token

substitutions

type : JSON Object Array

required : No

description - Custom substitutions to be done in the message body before sending the message out to each receiver. Each substitution values array should match the length of receiver list. The sample below would replace $$example$$ with the given value for each receiver according to the matching index.

sample :


                                

[
   {
      "placeHolder":"$$example$$",
      "values":[
         "te"
      ]
   }
]

enterpriseHierarchies

type : JSON Object Array

required : No

description - Each receivers enterprise hierarchy data to be sent with embedded surveys.

sample :


                                

[
   {
      "Key1":"value",
      "Key2":"value2"
   }
]

embedSensors

type : JSON Object Array

required : Yes (if sending content is defined in request)

description - Define the surveys to be embedded in the message body and the placeholder to which it should be embedded to. embedEmoticons will not work with SMS pushes.
shortURL or sensorID is required. If embedding more than one survey placeHolder is required.

sample :


                                

[
   {
      "shortURL":"sandbox",
      "emotingOption":"oneTime",
      "embedEmoticons":[
         "q1"
      ],
      "placeHolder":"emojot_sensor1"
   },
   {
      "sensorID":"5aa77a67f0a2440060a66da3",
      "validityPeriod":{
         "start":<unix time stamp in miliseconds>,
         "end":         <optional:unix time stamp in miliseconds>
      },
      "placeHolder":"emojot_sensor2"
   }
]

Sample Request - Share a survey via email


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{"emails":["you@yourdomain.com"],"token":"token-123"}'
                                            'https://api.emovyz.com/api/1.0.0/messages'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{"emails":["you@yourdomain.com"],"token":"token-123"}';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/messages',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Sample Request - Share a survey via email, Content based


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{ "emails" : ["test@test.com"], "content" : "This is my first emovyz email {URL}", "embedSensors" : [{"shortURL" : "sandbox"}]}'
                                            'https://api.emovyz.com/api/1.0.0/messages'
                                        


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{ "emails" : ["test@test.com"], "content" : "This is my first emovyz email {URL}", "embedSensors" : [{"shortURL" : "sandbox"}]}';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/messages',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Sample Request - Share a survey via SMS


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{"mobileNumbers":["+xxxxxxxxxxx"],"token":"token-123"}'
                                            'https://api.emovyz.com/api/1.0.0/messages' 


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{"mobileNumbers":["+xxxxxxxxxxx"],"token":"token-123"}';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/messages',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Sample Request - Share a survey via SMS, Content based


                                            curl -XPOST -H 'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID: 5aa76ca035c9962bfc3c55d9' -H "Content-type: application/json" -d
                                            '{ "mobileNumbers" : ["+94xxxxxxxxx","+94xxxxxxxxx"], "content" : "This is my first emovyz msg {URL}","embedSensors" : [{"shortURL" : "sandbox"}]}'
                                            'https://api.emovyz.com/api/1.0.0/messages' 


                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9',
    'Content-type': 'application/json'
};

var dataString = '{ "mobileNumbers" : ["+94xxxxxxxxx","+94xxxxxxxxx"], "content" : "This is my first emovyz msg {URL}","embedSensors" : [{"shortURL" : "sandbox"}]}';

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/messages',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Social Media

/insights/social/keyword

Type - GET

Description - Get positive/neutral/negative sentiments that are available on Facebook/Twitter/Google+ public posts for a given keyword

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

type

type : string

required : Yes

description - Use to describe search type of the query.

keyword

type : string

required : Yes (If you are sending type as “keyword”)

description The keyword to search social media

sample : Trump

since

type : string

required : no (yes if search tweets)

description -Starting date to search tweets if twitter is true

sample - 2018-01-03

until

type : String

required : no (yes if search tweets)

description - End date to search tweets if twitter is true

sample - 2018-03-03

twitter

type : string (“true” of “false”)

required : No

description - This should be true to get twitter events related to query

sample : true

googlePlus

type : string (“true” of “false”)

required : No

description - This should be true to get Google Plus events related to query

sample : true

facebook

type : string (“true” of “false”)

required : No

description - This should be true to get Facebook events related to query

sample : true

Sample json object return in this endpoint.

{
  "facebook": {
    "negativeComments": [
      {
        "text": "We had YET ANOTHER School Shooting today! You and the Republican Controlled Congress have done NOTHING to stop them.",
        "query": "Trump",
        "polarity": 0,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=10160766162740725",
        "meta": {
          "language": "en"
        }
      }
    ],
    "neutralComments": [
      {
        "text": "Thank you president Trump GOD is with you I\u2019m sure we will win this battle of division and one day America will be one again under GOD and we would be a nation of GOD FAMILY and COUNTRY a nation under the consciences  of GOD !????????????",
        "query": "Trump",
        "polarity": 2,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=422832161462867",
        "meta": {
          "language": "en"
        }
      }
    ],
    "negative": 1,
    "positive": 1,
    "neutral": 1,
    "positiveComments": [
      {
        "text": "There is a clear picture that president Donald Trump will be in the White House for the next seven years.He\u2019s doing everything he can to make sure America is safe and prosperous.There is a visible evidence that he\u2019s doing a great job so far.I will definitely vote for him again????????",
        "query": "Trump",
        "polarity": 4,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=10160766168225725",
        "meta": {
          "language": "en"
        }
      }
    ]
  },
  "tweets": {
    "positiveTweets": [
      {
        "text": "RT @krassenstein: Like Father, Like Son...\n\nJust like Trump Sr. had an affair with a porn star shortly after Melania gave birth, Donald Tru?",
        "polarity": 4,
        "query": "Trump",
        "link": "https:\/\/twitter.com\/MarkTho36005301\/status\/975884623505801216",
        "meta": {
          "language": "en"
        }
      }
    ],
    "negativeTweets": [
      {
        "text": "RT @KrauseForIowa: Why is it nice that we have #UK allies? Why is it grand that  #Trump's done everything he possibly can to p*ss-off the #?",
        "polarity": 0,
        "query": "Trump",
        "link": "https:\/\/twitter.com\/ORDiane\/status\/975884620263702528",
        "meta": {
          "language": "en"
        }
      }
    ],
    "negative": 1,
    "positive": 1,
    "neutral": 1,
    "neutralTweets": [
      {
        "text": "RT @ProudResister: James Comey has memos.\n\nAndrew McCabe has memos.\n\nRobert Mueller has a grand jury.\n\nWe the People have the power to vote?",
        "polarity": 2,
        "query": "Trump",
        "link": "https:\/\/twitter.com\/Gsgirl0855\/status\/975884623480836096",
        "meta": {
          "language": "en"
        }
      }
    ]
  }
}

Sample Request - Get positive/neutral/negative sentiments that are available on Facebook/Twitter/Google+ public posts for a given keyword



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/social/keyword?keyword=Trump&twitter=true&googlePlus=true&facebook=true&type=keyword'
                                        

                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/social/keyword?keyword=Trump&twitter=true&googlePlus=true&facebook=true&type=keyword',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

/insights/social/page

Type - GET

Description - Return positive/neutral/negative sentiments that are available on Facebook public posts for a given page or post

Headers

Authorization

type : string

required : yes

description - OAuth Token Obtained from the OAuth Token Endpoint described above.

sample - Bearer 0a80401de8adad0c2310d2f41add474a

companyID

type : string

required : yes

description - The unique ID for the account in Emovyz. This can be obtained from the dashboard.

sample - 5aa76ca035c9962bfc3c55d9

Params -

pageID

type : string

required : Yes (either pageID or postID)

description - contains the page Id of a facebook page

sample : 153080620724

postID

type : string

required : Yes (either pageID or postID)

description contains the post Id of a facebook page

sample : 153080620724_10160776720885725

Sample json object return in this endpoint.

{
  "facebook": {
    "negativeComments": [
      {
        "text": "We had YET ANOTHER School Shooting today! You and the Republican Controlled Congress have done NOTHING to stop them.",
        "query": "Trump",
        "polarity": 0,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=10160766162740725",
        "meta": {
          "language": "en"
        }
      }
    ],
    "neutralComments": [
      {
        "text": "Thank you president Trump GOD is with you I\u2019m sure we will win this battle of division and one day America will be one again under GOD and we would be a nation of GOD FAMILY and COUNTRY a nation under the consciences  of GOD !????????????",
        "query": "Trump",
        "polarity": 2,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=422832161462867",
        "meta": {
          "language": "en"
        }
      }
    ],
    "negative": 1,
    "positive": 1,
    "neutral": 1,
    "positiveComments": [
      {
        "text": "There is a clear picture that president Donald Trump will be in the White House for the next seven years.He\u2019s doing everything he can to make sure America is safe and prosperous.There is a visible evidence that he\u2019s doing a great job so far.I will definitely vote for him again????????",
        "query": "Trump",
        "polarity": 4,
        "link": "https:\/\/www.facebook.com\/DonaldTrump\/posts\/10160766042380725?comment_id=10160766168225725",
        "meta": {
          "language": "en"
        }
      }
    ]
  }
}

Sample Request - Get positive/neutral/negative sentiments that are available on Facebook page for a given pageID



                                            curl -XGET -H
                                            'Authorization: Bearer 0a80401de8adad0c2310d2f41add474a' -H
                                            'companyID:5aa76ca035c9962bfc3c55d9'
                                            'https://api.emovyz.com/api/1.0.0/insights/social/page?pageID=153080620724'
                                        

                                            

var request = require('request');

var headers = {
    'Authorization': 'Bearer 0a80401de8adad0c2310d2f41add474a',
    'companyID': '5aa76ca035c9962bfc3c55d9'
};

var options = {
    url: 'https://api.emovyz.com/api/1.0.0/insights/social/page?pageID=153080620724',
    headers: headers
};

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
}

request(options, callback);

Error Handling

API returns following general http error codes

Error Code Definition
404 Invalid API endpoint
401 Not Authorized. Check whether authorization header is sent with access token in the following format authorization : bearer <access token>
403 Forbidden. You don’t have enough access control privileges to access the resource
500 Internal server error
400 Bad request. This is due to invalid input parameters. More information is given below

Invalid Input Parameters

All input parameters should be of the type specified in the doc. If not the endpoint will return 400.

If the input parameter is invalid type or not a member of given enum following object will return.


                                    

{

"dataPath": ".emoteSeries",

     "params": {

"allowedValues": [

 "all",

 "first",

 "last"

],

},

"message": "should be equal to one of the allowed values"

}

dataPath - it indicates the invalid parameter.

message - descriptive reason for invalidation.

params - giving more context into the invalidation.

The “params” parameter can be one of the following depending on the invalidation type.

enum-

{allowedValues :<array_of_allowed_values>}

required-

{missingProperty: <missed_required_value>}

Type mismatch -

{ type : <expected_type>}

Apart from these validations there can be dynamic property validation. This includes sensorId, question, demographic. If those values are invalid a json object of following formats will be returned.



                                    

{

"dataPath": ".sensorId",

"message": "invalid sensor id"

}

{

"dataPath": ".question",

"message": "invalid question"

}

{

"dataPath": ".question",

"message": "not a customer satisfaction index type (nps,ces,csat1,csat2) type question"

}

{

"dataPath": ".demographic",

"message": "the question is not in demographic type"

}

Initialization

Add following script of emovyz-sdk.js to your html page.

                                    
                                            

<script src="../emovyz-sdk.js"></script>

Create an emovyz instance as follows. For that you need the company ID and the api key. You can find those from emovyz dashboard. Go to profile -> update profile in emovyz dashboard.

                                    
                                        
var emovyz = Emovyz({
       company_id:"5af561f008ea44504d6d6829",
       api_key:"ec42b1b15769e804d94cc7ac62dcc3da"
});

Authorization

To perform authorization manually you need to send the api key in your profile to authorize function.

                                    
                                        
emovyz.authorize(<apiKey>, function(response){
       if(response.status === 'success'){
         //actions to do after authorization
       }
       else{
         console.log('authorization failed');
       }
});

Surveys

Surveys return the survey details and provides actions to perform on surveys.

Get Survey

Fetch all survey details you have for your company.

                                                
                                                                

emovyz.surveys.get(function (templates) {

         if (response.status === 'success'){

             //actions to do after survey loading var surveys = response.data; }

         else {

             console.log('template loading failed');

         }

});

                                                
                                                    

{
   "activities":[
      {
         "id":"5aa77a67f0a2440060a66da3",
         "name":"VOC-Retail",
         "title":"Welcome to our store",
         "state":"Active",
         "type":"campaign",
         "startsOn":1520838840000,
         "endsOn":1523603640000,
         "urls":{
            "shortUrl":"sandbox",
            "companyUrl":"demoadmin",
            "sensorUrl":"sandbox"
         },
         "questions":[ Question JSON Objects Array],
         "createdOn":1520926275956,
         "loyaltyFields":["name","email"],
         "companyID":"5aa76ca035c9962bfc3c55d9",
         "companyLogo":"https://storage.emovyz.com/logos/company_logo/5aa76ca035c9962bfc3c55d9.png"
      }
   ],
   "serverTime":1521083552883
}

Create survey

Argument Mandatory Description
templateId Yes Specify the selected template id
surveyName Yes Specify the survey name. This name can be any name which you want
shortUrlForSurvey No Short url for the survey. When you load survey you have to use this shortURL and it must be unique. If is not specified, a system generated shortURL will be assigned and details will be sent to you in the response.
                                                    
                                                        

emovyz.surveys.create({ templateId:'Food', surveyName:'FoodSurvey', shortUrlForSurvey:'foodsurvey' }, function (response) {

   if (response.status === 'success'){

       //actions to do after suervey creation from template

   } else {

      console.log('sensor creation from template failed. ' + response.data.message);

   }

});

{
  "status": "success",
  "data": {
    "message": "survey created success",
    "surveyId": "",
    "surveyUrl": "https://emovyz.com/survey"
  }
}

Skin

Update survey logo and the background image

Argument Madatory Description
surveyId Yes Survey Id of the survey.
backgroundFile No Specify the background image file from the file input. See the example code for more details.
logoFile No Specify the logo file from the file input. See the example code for more details.

Update background of the survey

                                    
                                        

var file = document.getElementById(<yourInputId>).files[0];

emovyz.surveys.skin.update( { surveyId : '5aa77a67f0a2440060a66da3', backgroundFile : file } , function (response) {

      // handle success and failure

});

Update survey logo

                                    
                                        

var file = document.getElementById(<yourInputId>).files[0];

emovyz.surveys.skin.update( { surveyId : '5aa77a67f0a2440060a66da3', logoFile : file } , function (response) {

      // handle success and failure

});

Update both survey logo and background image

                                        
                                            

var backgroundFile = document.getElementById(<yourBackgroundInputId>).files[0];

var logoFile = document.getElementById(<yourLogoInputId>).files[0];

emovyz.surveys.skin.update( { surveyId : '5aa77a67f0a2440060a66da3', logoFile : logoFile, backgroundFile : backgroundFile } , function (response) {

    // handle success and failure

});

{
  "status": "success",
  "data": {
    "message": "survey updated success",
    "surveyId": "5b1787d7a5bc1313b8135f5c",
    "surveyUrl": "https://emovyz.com/surveyDemo"
  }
}

Templates

This object retuns the template details and the actions which can perform on survey templates.

Argument Mandatory Description
id No Specify the templateID
category No Specify the template category name

Get all survey templates

                                                    
                                                        

emovyz.templates.get({},function (templates) {

    if (response.status === 'success'){

       //actions to do after template loading

    var templates = response.data;

    } else {

       console.log('template loading failed');

    }

});

{
  "status": "success",
  "data": [
    {
      "templates": [
        {
          "screenshot": "http:\/\/storage.emovyz.com\/pictures\/template_screenshots\/5aced9ce7da6c6000a250f83.PNG",
          "name": "App GroupID",
          "id": "5addd96bb4c2704cf96fcab4",
          "sandboxUrl": "https:\/\/dev.emojot.com\/agid"
        }
      ],
      "category": "Food"
    },
    {
      "templates": [
        {
          "screenshot": "http:\/\/storage.emovyz.com\/pictures\/template_screenshots\/5acee0987da6c6000a250fb3.PNG",
          "name": "app multiselect",
          "id": "5ac20382121247053deb6490",
          "sandboxUrl": "https:\/\/dev.emojot.com\/ams"
        }
      ],
      "category": "Hospitality"
    }
  ]
}

Get survey template by Id

                                                    
                                                        

emovyz.templates.get({id : },function (templates) {

    if (response.status === 'success'){

       //actions to do after template loading

    var templates = response.data;

    } else {

       console.log('template loading failed');

    }

});


                                        

Get survey templates for category

                                                    
                                                        

emovyz.templates.get({category : },function (templates) {

    if (response.status === 'success'){

       //actions to do after template loading

    var templates = response.data;

    } else {

       console.log('template loading failed');

    }

});


                                        

Customers

Loyalty customers are the customers who add their details when response to the survey

Upload customer data

This will provide a way to submit CSV file which contain customers data.

Argument Mandatory Description
csvFile Yes Pass the file which you get from the file input
listName Yes Name of the customer list. You can pass this as null if you not need to create a list while uploading
                                            
                                                

var csvFile = document.getElementById(<yourInputId>).files[0];

emovyz.customers.add( { csvFile:csvFile, listName:'name' } , function (response) {

      // handle success and failure

});

{
  "status": "success",
  "data": {
    "status": "Completed processing data sent.\nNew Entries : 0 \nUpdated Entries : 2 \nRejected : 0",
    "refresh": true,
    "rejected": [

    ]
  }
}

Get Customer Data

Fetch loyalty customer data which is bind to your company

                                            
                                                

emovyz.customers.get(function (response) {

     // handle success and failure

});

{
  "recordsTotal": 185,
  "draw": "1",
  "recordsFiltered": 185,
  "records": [
    {
      "_id": "5a8d593530bb210e3f6e6314",
      "companyID": "5aa76ca035c9962bfc3c55d9",
      "Name": "User Name"
    }
  ]
}

Get Customer Lists

When uploading the customers data you can move that data to the list. From this you can fetch that list data. One list can contain 0 or more customers.

                                            
                                                

emovyz.customers.lists.get(function (response) {

     // handle success and failure

});

{
  "status": "success",
  "data": {
    "lists": [
      {
        "_id": "5b0f9b469f5578057f0b27bd",
        "name": "list1",
        "lastUpdated": 1527749446175
      }
    ]
  }
}

Get loyalty customers for a specified list

Argument Mandatory Description
listName Yes Specify unique list name
                                            
                                                

emovyz.customers.get( {listName:'name'} , function (response) {

      // handle success an8d failure

});

                                            
{
  "status": "success",
  "data": {
    "recordsTotal": 13,
    "recordsFiltered": 2,
    "userDetails": [
      {
        "_id": "5b052f647bac630ed8b6ae4c",
        "companyID": "5af561f008ea44504d6d6829",
        "Name": "john",
        "Email": "john@gmail.com",
        "lastUpdated": 1528269019169,
        "lastUpdatedDate": "2018-06-06T07:10:19.169Z",
        "timeRegistered": 1527066468041,
        "clienteleList": [
          "lis2",
          "list5"
        ]
      },
      {
        "_id": "5b052f657bac630ed8b6ae4d",
        "companyID": "5af561f008ea44504d6d6829",
        "Name": "Sheril",
        "Email": "sheril@gmail.com",
        "lastUpdated": 1528269018039,
        "lastUpdatedDate": "2018-06-06T07:10:18.039Z",
        "timeRegistered": 1527066469258,
        "clienteleList": [
          "lis2"
        ]
      }
    ]
  }
}

Save Customers to List

Save selected customer to new a list

Argument Mandatory Description
listName Yes Specify list name
Yes pass the user ids as a array list
                                    
                                        
                                            
                                                

var userList = ['5af93ce5cef0170043421edb', '5af93ce5cef0170043421edc', '5af93ce5cef0170043421edd'];

emovyz.customers.lists.create( { listName:'name', userIdList:userList } , function () {

      // handle success and failure

});

Campaigns

Get available campaign data which is initiate from the SDK, API or from the dashboard. The each email you send to customer is considered as a campaign.

Argument Mandatory Description
campaignType Yes The campaign type need to get data . Default value is emailCampaigns
origin No This can be clientele or loyalty
pagination No This is a json object which contain pageSize and start index

Get all available email campaigns

                                        
                                            

var page ={

       pageSize : 25, //required entity size

       start : 0 //current data start point

}

emovyz.campaigns.get( { campaignType : 'emailCampaigns', origin : 'clientele', pagination : page } , function (response) {

       //handle success and failure

});

{
  "status": "success",
  "data": {
    "code": 200,
    "docs": [
      {
        "_id": "5b1788d9a5bc1313b8135f61",
        "companyID": "5af561f008ea44504d6d6829",
        "content": {
          "subject": "This is test2",
          "body": "<p>TEST&nbsp;&nbsp;http:\/\/dev.emojot.com\/eS11&nbsp;<\/p>",
          "from": "ishan@emojot.com",
          "to": [
            "vishmi@emojot.com",
            "ishan@emojot.com"
          ],
          "autoGenerated": false,
          "origin": "clientele",
          "activityID": [
            {
              "shortURL": "eS11"
            }
          ],
          "campaignName": "This is test2_Campaign",
          "timestamp": "2018-06-06T07:10:17.217Z"
        },
        "lastDeliveryEventTimeStamp": [
          {
            "Email": "vishmi@emojot.com",
            "timestamp": 1528269024
          },
          {
            "Email": "ishan@emojot.com",
            "timestamp": 1528269024
          }
        ],
        "delivered": [
          "vishmi@emojot.com",
          "ishan@emojot.com"
        ]
      }
    ],
    "totalMatchingDataCount": 11
  }
}

Get email campaigns initiated through emovyz sdk/api

                                        
                                            

emovyz.campaigns.get( { campaignType : 'emailCampaigns', origin : 'clientele' } , function (response) {

        //handle success and failure

});

{
  "status": "success",
  "data": {
    "code": 200,
    "docs": [
      {
        "_id": "5b1788d9a5bc1313b8135f61",
        "companyID": "5af561f008ea44504d6d6829",
        "content": {
          "subject": "This is test2",
          "body": "<p>TEST&nbsp;&nbsp;http:\/\/dev.emojot.com\/eS11&nbsp;<\/p>",
          "from": "ishan@emojot.com",
          "to": [
            "vishmi@emojot.com",
            "ishan@emojot.com"
          ],
          "autoGenerated": false,
          "origin": "clientele",
          "activityID": [
            {
              "shortURL": "eS11"
            }
          ],
          "campaignName": "This is test2_Campaign",
          "timestamp": "2018-06-06T07:10:17.217Z"
        },
        "lastDeliveryEventTimeStamp": [
          {
            "Email": "vishmi@emojot.com",
            "timestamp": 1528269024
          },
          {
            "Email": "ishan@emojot.com",
            "timestamp": 1528269024
          }
        ],
        "delivered": [
          "vishmi@emojot.com",
          "ishan@emojot.com"
        ]
      }
    ],
    "totalMatchingDataCount": 10
  }
}

Get email campaigns initiated through emovyz dashboard

                                        
                                            

emovyz.campaigns.get( { campaignType : 'emailCampaigns', origin : 'loyalty' } , function (response) {

       //handle success and failure

});

{
  "status": "success",
  "data": {
    "code": 200,
    "docs": [
      {
        "_id": "5b0e275f06cf6c062030d54e",
        "companyID": "5af561f008ea44504d6d6829",
        "content": {
          "subject": "Sensor demo",
          "body": "<p>This is the sensor&nbsp;&nbsp;http:\/\/dev.emojot.com\/sensordemose1&nbsp;<\/p>",
          "from": "ishan@emojot.com",
          "to": [
            "shahani@emojot.com",
            "manjula@emojot.com",
            "vishmi@emojot.com",
            "ishan@emojot.com"
          ],
          "autoGenerated": false,
          "origin": "loyalty",
          "activityID": [
            {
              "shortURL": "sensordemose1"
            }
          ],
          "campaignName": "Sensor demo_Campaign",
          "timestamp": "2018-05-30T04:23:59.329Z"
        },
        "lastDeliveryEventTimeStamp": [
          {
            "Email": "shahani@emojot.com",
            "timestamp": 1527654243
          },
          {
            "Email": "manjula@emojot.com",
            "timestamp": 1527654243
          },
          {
            "Email": "vishmi@emojot.com",
            "timestamp": 1527654243
          },
          {
            "Email": "ishan@emojot.com",
            "timestamp": 1527654243
          }
        ],
        "delivered": [
          "shahani@emojot.com",
          "manjula@emojot.com",
          "vishmi@emojot.com",
          "ishan@emojot.com"
        ],
        "open": [
          "vishmi@emojot.com",
          "manjula@emojot.com",
          "shahani@emojot.com"
        ]
      }
    ],
    "totalMatchingDataCount": 1
  }
}

Share Survey as E-mail

Email created survey to customer list. Before that you need customer list and the survey.

Argument Mandatory Description
campaignName Yes Specify name for campaign. Each email you send consider as a unique campaign.
customerList Yes Specify the list name
emailData Yes This is a json object which contain required data when send email.Check the example code
                                            
                                                

var emailObject = {

content : 'This is a test mail {URL}',

survey : 'testSurvey', //url or shortUrl of survey (https://emovyz.com/testSurvey or testSurvey)

subject : 'Hello there',

from : 'you@yourdomain.com',

fromName : 'yourName' };

emovyz.campaigns.email.send( { campaignName:'campaign', customerList:'list', emailData:emailObject } , function (response) {

      //handle success and failure

});

{
  "status": "success",
  "data": {
    "message": "Your emails have been queued successfully"
  }
}

Send SMS to selected customers

Can share survey information with selected customers using SMS. Specifying a campaign name is optional. Can specify a contact list name or a numbers array.

Argument Mandatory Description
content Yes message content
survey No short Url of the survey
mobileNumbers Yes a contact list name or a numbers array
                                            
                                                

var args = {

content : 'This is a test ssm {URL}',

survey : 'testSurvey', //url or shortUrl of survey (https://emovyz.com/testSurvey or testSurvey)

mobileNumbers : ['+9*******', '+1******'] // listName : listName

emovyz.campaigns.sms.send( args , function (response) {

      //handle success and failure

});

{
  "status": "success",
  "data": {
    "message": "Your emails have been queued successfully"
  }
}

Analytics

Get analytic data based on location, type, time, demographic, interaction

Argument Mandatory Description
analyticType Yes Define analytic type. Valid values are location,time,demographic,type,interaction
survey Yes Pass survey id
question No Question id of the survey
groupBy No How the response need to be group. Valid values are company and survey
timeInterval No Define time filter. This should be json object with define of min and max.This value should be in milisecond
demographicQuestion Pass demographic question id when get demographic data.

Get location based analytics

                                        
                                                        

emovyz.analytics.get( { analyticType:'location', survey:'5aa77a67f0a2440060a66da3', question:'q1' } , function(response){

     //handle success and failure

});

//time interval is optional and should be an object as follows.

{

  min: Epoch time for start time,

  max: Epoch time for start time

}

{
  "status": "success",
  "data": [
    {
      "_id": "Sri Lanka",
      "emotes": [
        {
          "emote": "q1",
          "count": 3
        },
        {
          "emote": "q2",
          "count": 3
        }
      ],
      "total": 6
    }
  ]
}

Get time based analytics

                                        
                                                        

emovyz.analytics.get( { analyticType : 'time', survey : '5aa77a67f0a2440060a66da3', question : 'q1' } , function(response){

      //handle success and failure

});

{
  "status": "success",
  "data": {
    "emoteAccumulation": [
      {
        "emote": "q5",
        "timeBasedAccumulation": [

        ],
        "color": "#489a7f"
      },
      {
        "emote": "q4",
        "timeBasedAccumulation": [

        ],
        "color": "#9b1703"
      },
      {
        "emote": "q2",
        "timeBasedAccumulation": [
          [
            [
              2018,
              4
            ],
            3
          ]
        ],
        "color": "#674219"
      },
      {
        "emote": "q1",
        "timeBasedAccumulation": [
          [
            [
              2018,
              4
            ],
            3
          ]
        ],
        "color": "#779b8d"
      }
    ],
    "ecoSigs": [

    ]
  }
}

Get demographic based analytics

                                        
                                            

emovyz.analytics.get( { analyticType : 'demographics', survey : '5aa77a67f0a2440060a66da3', question : 'q1', demographicQuestion : 'q1' } , function(response){

      //handle success and failure

});

//demographicQuestionID is mandatory and it is one of the demographic question's id for the survey.

{
  "status": "success",
  "data": {
    "response": true,
    "details": "Success",
    "result": {
      "analysis": [
        {
          "name": "q5",
          "color": "#489a7f",
          "data": [
            0,
            0,
            0,
            0
          ]
        },
        {
          "name": "q4",
          "color": "#9b1703",
          "data": [
            0,
            0,
            0,
            0
          ]
        },
        {
          "name": "q2",
          "color": "#674219",
          "data": [
            0,
            0,
            3,
            0
          ]
        },
        {
          "name": "q1",
          "color": "#779b8d",
          "data": [
            0,
            0,
            0,
            3
          ]
        }
      ],
      "demographics": [
        {
          "id": "q5",
          "imgSrc": "ico109",
          "color": "#489a7f",
          "imageType": "png",
          "hidden": false
        },
        {
          "id": "q4",
          "imgSrc": "ico109",
          "color": "#9b1703",
          "imageType": "png",
          "hidden": false
        },
        {
          "id": "q2",
          "imgSrc": "ico109",
          "color": "#674219",
          "imageType": "png",
          "hidden": false
        },
        {
          "id": "q1",
          "imgSrc": "ico109",
          "color": "#779b8d",
          "imageType": "png",
          "hidden": false
        }
      ]
    }
  }
}

Get suervey type based analytics

                                        
                                            

emovyz.analytics.get( { analyticType : 'time', sensor : '5aa77a67f0a2440060a66da3', question : 'q1' }, function(response){

      //handle success and failure

});

{
  "status": "success",
  "data": {
    "activities": {
      "5b0542087bac630ed8b6ae52": {
        "emoteAccumulation": [
          {
            "emote": "q5",
            "percentage": 0,
            "count": 0,
            "emotag": "#q5",
            "emoteColor": "#489a7f",
            "perceptic": "ico109"
          },
          {
            "emote": "q4",
            "percentage": 0,
            "count": 0,
            "emotag": "#q4",
            "emoteColor": "#9b1703",
            "perceptic": "ico109"
          },
          {
            "emote": "q2",
            "percentage": 50,
            "count": 3,
            "emotag": "#q2",
            "emoteColor": "#674219",
            "perceptic": "ico109"
          },
          {
            "emote": "q1",
            "percentage": 50,
            "count": 3,
            "emotag": "#q1",
            "emoteColor": "#779b8d",
            "perceptic": "ico109"
          }
        ],
        "totalCount": 6
      }
    }
  }
}

Get survey interaction based analytics

                                        
                                            

emovyz.analytics.get( { analyticType : 'interaction', groupBy : 'survey' } , function(response){

//groupBy can be specified as 'survey'. default is 'company'

     //handle success and failure

});

{
  "status": "success",
  "data": {
    "result": {
      "5b0d7b07fe377a13c29743a7": {
        "uniqueViews": 1,
        "totalViews": 1,
        "uniqueEmotes": 0,
        "totalEmotes": 0
      },
      "5b0542177bac630ed8b6ae57": {
        "uniqueViews": 1,
        "totalViews": 2,
        "uniqueEmotes": 0,
        "totalEmotes": 0
      },
      "5b0e265306cf6c062030d549": {
        "uniqueViews": 5,
        "totalViews": 13,
        "uniqueEmotes": 1,
        "totalEmotes": 7
      },
      "5afe779a0cfe607e68020f8a": {
        "uniqueViews": 1,
        "totalViews": 4,
        "uniqueEmotes": 1,
        "totalEmotes": 1
      },
      "5b054c2c915d721c8e22dbf4": {
        "uniqueViews": 2,
        "totalViews": 6,
        "uniqueEmotes": 2,
        "totalEmotes": 25
      },
      "5b0d35be825e55118d8062c5": {
        "uniqueViews": 1,
        "totalViews": 1,
        "uniqueEmotes": 0,
        "totalEmotes": 0
      },
      "5b05478628ded31c6c0e78bd": {
        "uniqueViews": 1,
        "totalViews": 1,
        "uniqueEmotes": 1,
        "totalEmotes": 1
      },
      "5b0542087bac630ed8b6ae52": {
        "uniqueViews": 2,
        "totalViews": 6,
        "uniqueEmotes": 2,
        "totalEmotes": 15
      }
    }
  }
}