Documentation 1.0
Preconditions
Each API call, described below, needs API Key to be provided in the header of request. The example of simplest request (ex. get the NPS score) may look like following:
GET /nps HTTP/1.1
Host: https://api.clever-insight.com
key: {you api key}
Content-Type: application/json
Accept: application/json
You can simply log in to the system by using link of the following format https://api.clever-insight.com?key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
By adding 'menu=0' parameter to the link - you can hide the menu and the ability to move thru the CleverInsight pages
API Methods Specification
Doc Root
Method: | GET |
---|---|
URL: | https://api.clever-insight.com/ |
Params: | NONE |
Description: | Current Document |
Returns: | Current Document |
Response Example: |
HTTP Code: 200 OK
HTTP Body:
|
Login
Method: | POST | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL: | https://api.clever-insight.com/login | ||||||||||||||||||||||||||||||
Params: |
|
||||||||||||||||||||||||||||||
Request Example: |
POST /send HTTP/1.1 |
||||||||||||||||||||||||||||||
Description: | Call this to get your api key for future requests | ||||||||||||||||||||||||||||||
Returns: | Your api key | ||||||||||||||||||||||||||||||
Response Example: |
HTTP Code: 200 OK
HTTP Body:
{"apiKey":"46cbc74a803a5b5816b2e773d4bc5613"} |
Survey Send
Method: | POST | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL: | https://api.clever-insight.com/send | ||||||||||||||||||
Params: |
|
||||||||||||||||||
Request Example: |
POST /send HTTP/1.1 |
||||||||||||||||||
Description: | Call this to send survey to your client | ||||||||||||||||||
Returns: | Associative array with sent and ignored count | ||||||||||||||||||
Response Example: |
HTTP Code: 200 OK
HTTP Body:
{"sent":1,"ignored":0} |
NPS
Method: | GET | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL: | https://api.clever-insight.com/nps | ||||||||||||||||||||||||||||||
Params: |
|
||||||||||||||||||||||||||||||
Request Example: |
GET /nps?from=01-01-2017 HTTP/1.1 |
||||||||||||||||||||||||||||||
Description: | Call this to get NPS data for the period | ||||||||||||||||||||||||||||||
Returns: | Returns associative data array | ||||||||||||||||||||||||||||||
Response Example: |
HTTP Code: 200 OK
HTTP Body:
{"result":{"index":"0.00","data":{"total":0,"promoters":0,"passive":0,"detractors":0},"from":"08-12-2024","to":"08-12-2024"}} |
Responded Surveys List
Method: | GET | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL: | https://api.clever-insight.com/responses | ||||||||||||||||||||||||||||||||||||||||||
Params: |
|
||||||||||||||||||||||||||||||||||||||||||
Request Example: |
GET /responses?client=example@example.com HTTP/1.1 |
||||||||||||||||||||||||||||||||||||||||||
Description: | Call this if you want to get list of responded surveys. Use optional parameters to filter the result | ||||||||||||||||||||||||||||||||||||||||||
Returns: | Returns associative data array | ||||||||||||||||||||||||||||||||||||||||||
Response Example: |
HTTP Code: 200 OK
HTTP Body:
[{"email":"client@example.com","comment":"The best service i ever had!","mark":10,"customData":[],"created":"08-12-2024 01:12","updated":"08-12-2024 20:25"}] |
List of Surveys
Method: | GET | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
URL: | https://api.clever-insight.com/list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Params: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Request Example: |
GET /list?limit=1 HTTP/1.1 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Description: | Call this if you want to get list of sent surveys. Use optional parameters to filter the result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns: | Returns associative data array | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Response Example: |
HTTP Code: 200 OK
HTTP Body:
{"result":{"total":1,"nps":{"index":"100.00","data":{"total":1,"promoters":1,"passive":0,"detractors":0}},"requests":[{"email":"client@example.com","comment":"The best service i ever had!","mark":10,"customData":[],"created":"08-12-2024 01:12","updated":"08-12-2024 20:25"}]}} |
Webhooks Methods Specification
Response Webhook
Method: | POST |
---|---|
URL: | Bruger er defineret |
Params: | NONE |
Request Example: |
POST /[user defined] HTTP/1.1<br/>Host: [user defined]<br/>Content-Type: application/json<br/>Accept: application/json<br/>Content-Length: 339<br/><br/>{"responses":[{"id":"84", "language":"da", "country":"dk", "date":"2017-03-01T15:25:43.511Z", "name":"John Doe", <br/>"email":"j.doe@example.com", "tags":[{"key":"pet", "value":"Lessie", "comment":"The best friend"}], <br/>"company":"Some Company LTD", "comment":"Love to visit Some Company LTD. I think it is the best one in the branch", <br/>"mark":10}]} |
Description: | The User defined url will be called each time new response will come |
Sends: | Associative array of responses |
Response Example: |
HTTP Code: 200
HTTP Body:
HTTP/1.1 200 OK<br/>Content-Length: 0<br/> |