POST : https://{{env}}.survey2connect.com/v2/api/tickets
The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.
"Content-Type": "application/json"
type: Api Key Key: x-api-key token: value from portal
Request Body
{ "timeFilter": { "amount": 10, "period":"days", "type":"rolling" }, "resStatus": ["1"], "eData": { "City": "delhi" } }
Supported Filters
Field | Type | Mandatory | Description |
timeFilter | Object | No |
Rolling Filter (e.g. Last 7 days, Last 3 months etc.) { amount:7, period:"days/months/years" type:"rolling" } Before/After Time filter (e.g. before Nov 1st 2020, After July 15th 2020) { operand: ["dd/mm/yyyy"] type: "before/after" } Relative Time Filter (e.g. Today, This Month, Last Month, Previous Year) { amount: 7, period: "day/week/month/year", type: "relative" } Between Time Filter (e.g. between July 15th 2020 & Nov 1st 2020) { operand: ["dd/mm/yyyy","dd/mm/yyyy"] type:"between" } |
resStatus | Array | No |
Integer(0-2)
0 : Incomplete/Partial Responses 1: Complete Responses 2 : Disqualified Responses |
collectorIds | Array | No |
Array of collector ids
|
eData | Object | No |
Key value pair of any custom variables
|
Request Sample
curl --location --request 'https://az1.survey2connect.com/v2/api/tickets' \
--header 'Authorization: Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFs' \
--header 'Content-Type: application/json' \
--data-raw '{
}
var myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFs”); myHeaders.append("Content-Type", "application/json"); var requestOptions = { method: POST, headers: myHeaders, body : raw, redirect: 'follow' }; fetch("https://az1.survey2connect.com/v2/api/tickets", requestOptions) .then(response => response.text()) .then(result => console.log(result)) .catch(error => console.log('error', error));
Responses
{ "data":[ { "_id": "64897f4f45992536a59677af", "priority": "High", "assignee": { "_id": "611ba3570f7a4124613c2386", "email": "Test", "name": "test@abc.com", }, "name": "T00181", "created_at": "2023-06-14 14:20:23", "survey_title": "Tickets" "modified_at": "2023-06-14 14:20:23", "status": "Open", "href": "https://az1.survey2connect.com/v2/api/tickets/64897f4f45992536a59677af" }, { "_id": "64897f4f45992536a59677aa", "priority": "High", "assignee": { "_id": "611ba3570f7a4124613c2386", "email": "Test", "name": "test@abc.com", }, "name": "T00181", "created_at": "2023-06-14 14:20:23", "survey_title": "Tickets" "modified_at": "2023-06-14 14:20:23", "status": "Open", "href": "https://az1.survey2connect.com/v2/api/tickets/64897f4f45992536a59677aa" }, { "_id": "64897f4f45992536a59677ff", "priority": "High", "assignee": { "_id": "611ba3570f7a4124613c2386", "email": "Test", "name": "test@abc.com", }, "name": "T00181", "created_at": "2023-06-14 14:20:23", "survey_title": "Tickets" "modified_at": "2023-06-14 14:20:23", "status": "Open", "href": "https://az1.survey2connect.com/v2/api/tickets/64897f4f45992536a59677ff" } ], length : "3" }
{ "error": { "name": "Unauthorized", "message": "The authorization token was not provided." } }
{ "error": { "name": "Internal Server Error", "message": "We were not able to process your request" } }
Note: Please do not share your tokens in publicly accessible areas or to anyone. Also, this token generated is valid for 24 hours only. After its expiry, you can regenerate the access token from the same API endpoint by passing the username and password or from the refresh token API with the help of refresh token.