Manual fetch
This API to gives a copy all the responses submitted in Zykrr platform.
curl --location --request GET \
'https://zapi.api.zykrr.com/api/rest/{campaignId}/responses?startDate={start-iso-date}&endDate={end-iso-date}' \
--header 'Cookie: zykrr={login_token}'
The parts in the API that are variable are enclosed in curl brackets.
- Path parameter {campaignId} is the campaign id whos data you want to fetch.
- Query parameters {start-iso-date} and {end-iso-date} is the date range between which the responses you want.
- {login_token} is the token that you get from login API (See Appendix 1)
Following is a sample response body returned from the API
[
{
"id": "8265dc6f-e339-4cb4-8e0c-18da8df93732",
"campaignId": "0dc58955-6c0b-4c5c-a114-4192eb87f8c9",
"answers": {
"ee52f7d1-96be-4437-beb4-6667f8e36413": 2,
"420adde8-2c72-4e20-93fd-068f473d78b3": 8,
"c2406479-7ce2-4e1c-a0b0-384b8e8be4b9": 4,
"c3c77e03-9518-4c4f-8970-c816592d0e6b": 0,
"b0055957-385a-491f-aaec-3ef8239e3d2d": 5,
"a724f23e-8c55-4803-a88c-b0a1bacda735": 4,
"90fad279-11b9-43c2-b115-3c9664c48faa": "Lorem, ipsum dolor sit amet consectetur adipisicing elit.",
"5c354c2e-d3db-4669-8a5c-1039ac2e89f9": "yes",
"6dc1f15c-e577-4fa1-b271-c52418a2c4fe": "30 mins - 1.5 hrs",
"cad3a36b-16c5-4ed3-8cfe-3037247f34f7": "director",
"b43e9b01-37be-49b2-bb8d-1149ccd80aed": "Lorem, ipsum dolor sit amet consectetur adipisicing elit."
},
"participantInfo": {
"Name": "Diwakar",
"Email": "diwakar_singh_maurya@zykrr.com",
"Phone": "918800174323"
},
"createdAt": "2022-03-02T16:45:30.147Z",
"tags": [],
"comments": []
}
]
Description of the response body
- id is the zykrr system id for this response.
- campaignId field denotes the campaign id in which the response was submitted.
- answers contain all the questions and their answers submitted in the response as key-value pairs. If the respondent did not answer a question, then it’s key won’t be present in it.
- participantInfo contains information of the participant who submitted the response.
- createdAt contains the date-time in ISO format at which the response was submitted.
Answers given by participant for each question is sent in answers against the question id. Data type of RATING type questions is integer, that of MULTIPLE_CHOICE is an array of strings and that of OPENEND is a string.
Appendix 1: Login API
Before performing any read/write operations in zykrr system, you must have a login token. Login with your username and password through this API and acquire a login token. Below is a curl request for login. Replace your_username and your_password as per your account.
curl --location --request POST 'https://accounts.zykrr.com/api/login' \
--header 'username: {your_username}' \
--header 'password: {your_password}'
Example response:
{"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJkbiI6InVpZD1aeWtyciBEZW1vLG91PXVzZXJzLGRjPXp5a3JyIiwiZ3JvdXBzIjpbXSwiaWF0IjoxNjAwMzQ5MTM3LCJleHAiOjE2MDA0MzU1Mzd9.Wdh2lESM_6LKyioKgfuiXXmwC55Q-hBjlUjeB2LCvB2Ddtck_tGT0r5bQkMgc4Jj5h-SmMoZeUNzt9T5onmS0e4UtpsqScea0SqiSQTLHi1DRTnMCR1_zyy-T1tb6TFBPxHT-lvjLWN23O1XBjkFaq-d2pzscpMeK2IVBpbkLTKOg97knuoC46nnmo5gGI70fTl0DSksGtLwaDmF0ZUr_i88KJEXdieMptvjgfr-Hdx7ctHFaG_oweUO-aFnJDJw7jLwuz6B1-XfWkjZOd41w7SfwSfygwYNchfEFbUfwL6HrmcEs9lrLPkW-uyGoxzfDU1KyoJjkcSt7kTslckI5K3nXmQ9R6kUAeD-ZryqllAUm3vgRwuEXoN034KKPBwecp754eJ9lHqeDEHpPwXJ7a1e9vcOO8qW1B4QaRLlWeFwScxWYMCgHO5gbGh1_NzjsJ3dmFd5QSbdLJVxIh10ira8MLQXFxhOZ_LpR-F9VKn6kOlAXG-8f1I6wTCIL6oBIIrmrQu5USlc1yNSkmDP8Ra6WYwyz9Is5SI8c14sROjf4dd-OoeFSiwqFdQDdXOqIQT-_euBnEDy3nJG7c2OD5mu7pYgxGfCUGvTUTqY03V3Tb6VwSg_tMS4K8NKLvW9HKkT3q4tNcexlVNQS8jdSqkSBJzkZbJR0FokinhjSbc"}
The value of the token key in the response is the login token. It is valid for only 24 hours. Call this API again after 24 hours to get a new token.