ProProfs Survey Rest API Guide
ProProfs lets you use the REST API to get your survey responses.
This API application facilitates the collection of survey responses which you use for various reasons, such as market research, user engagement, and customer feedback.
Advantages of REST API:
-
Developers enjoy flexibility as REST can handle multiple call types.
-
It uses less bandwidth and provides fast execution.
-
It facilitates autonomous development across various parts of the project.
Get Your Survey Responses
Endpoint URL:
The endpoint URL given below is used to call the Rest API.
Request Method
POST
Request Format
JSON
Request Parameters:
Name | Required | Type | Description |
---|---|---|---|
token | Yes | String |
Your private API key for the responses.
|
sid | Yes | Integer | "sid" is the ID of the survey. You can find this in the URL when you are editing the survey in your Survey dashboard. |
limit | No | Integer | The number of records you want to get in one response. The number must be between 0 and 500. If the limit is not provided, the API will retrieve up to 500 responses. |
offset | No | Integer | A non-negative integer. For example, offset=1000 means that the API will return records that match your query starting with response number 1001. If offset is not provided, the API will start from the beginning, response number 1. |
date_from | No | String | You can request records for a particular date range. Format of ‘date from’ should be in (yyyy-mm-dd) |
date_to | No | String | You can request records for a particular date range. Format of ‘date to’ should be in (yyyy-mm-dd) |
How to get Survey ID (sid)
You can find this in the URL when you are editing the survey in the ProProfs Survey Maker.
Sample Code | JSON
Example Request
The request JSON object contains information about the survey id, limit, offset, date_from, and date_to.
Here is what the complete request will look like:
End Point: https://www.proprofs.com/survey/api/V1/
Accept content-type: application/JSON
Method: POST
Authentication token: Bearer be5d37edf67d0ac8a74aca630b0b0fef*****
Request body: JSON
{
"sid":351***,
"limit":10,
"offset":0,
"date_from": "2023-02-23",
"date_to": "2023-03-16"
}
Example Response [Success]
Here is how the response will look like
Content-Type: application/json
{
"status": "SUCCESS",
"code": "200",
"description": " ”,
"responses":[
{
"survey_id": "351****",
"attempt_id": "70319**",
"attempt_date": "Feb-23-2023 10:34 am",
"survey_title": "Sample survey",
"user_id": "1234",
"email": "tom@gmail.com",
"name": "tom**",
"question_answer":[
{
"question": "What's your name?",
"answer": "Tom**",
"type": "Name",
"question_id":103118***
},
{
"question": "What's your email?",
"answer": "tom**@gm***.com",
"type": "Email",
"question_id":1031182***
},
….,
]
}
You can find an example of all questions' responses as JSON here.
Example Response [Failed]
Content-Type: application/json
{
"status": "Error",
"code": "ERR1002",
"description": "Request method must be POST",
"responses": ""
}
Response Fields | Description |
---|---|
status | error when the operation failed. |
code | A unique error code. |
description |
The error text describes the error. |
responses | Returns data on success and blank if getting any error. |
Error Codes and Descriptions
Error Code | Description |
---|---|
ERR1001 | The content type must be application/json. |
ERR1002 | The request method must be POST. |
ERR1003 | Authorization is required. |
ERR1004 | A valid Bearer token is required. |
ERR1005 | The request body is empty. |
ERR1006 | Survey ID (sid) is not provided. |
ERR1007 | Empty API key. |
ERR1008 | Unauthorized Access Blocked |
ERR1009 | Upgrade your plan and try. |
ERR1010 | Invalid survey ID. |