This method allows you to fetch a specific response to a form.
Parameters
Your request data may contain the following parameters. GET or POST the object (as JSON) tohttps://api.kpaehs.com/v1/responses.info
.
Parameter | TypeScript | Example | Required | Description |
---|---|---|---|---|
token |
string |
"YOUR_TOKEN" |
Required | Your API Token |
pretty |
boolean |
true |
Optional | true means the response json will include white space for readability. Default is false . |
response_id |
number |
1024 |
Required | The id of the response. |
Example Request
Example Response
{ "ok": true, "response": { "id": 1024, "parent_response_id": null, "pending_followup_assignees_id": [], "created": 1476124461658, "updated": 1476718837845, "deleted": false, "latest": { "m_completer_id": "5804f0f40ef50473af5870e6", "m_submitter_id": "5804f0f40ef50473af587134", "started_on": 1476124172467, "submitted_on": 1476124461356, "received_on": 1476357332698, "version": 3, "form_version": 1, "location": { "lon": -97.90176526248575, "lat": 30.302495522720506, "accuracy": 957 }, "weather": { "temperature": 65, "icon": "wind", "windSpeed": 17 }, "responses": { "nearmissfld-fieldoffice": { "value": { "values": [ "5804f0f40ef50473af5870cd" ] }, "attachments": [] }, "nearmissfld-lob": { "value": { "values": [ "5804f0f40ef50473af5870d1" ] }, "attachments": [] }, "nearmissfld-client": { "value": { "values": [ "5804f0f40ef50473af5870d6" ] }, "attachments": [] }, "nearmissfld-misscategory": { "value": { "values": [ "working" ] }, "attachments": [] }, "nearmissfld-workingcategory-type": { "value": { "values": [ "walk-work-surface" ] }, "attachments": [] }, "nearmissfld-drivingcategory-type": { "value": { "values": [ "unsafe-road-conditions" ] }, "attachments": [] }, "nearmissfld-environmentalcategory-type": { "value": { "values": [ "inadequate-supplies" ] }, "attachments": [] }, "nearmissfld-bodypart": { "value": { "values": [ "eye" ] }, "attachments": [] }, "nearmissfld-severity": { "value": { "values": [ "low" ] }, "attachments": [] }, "nearmissfld-recurrence": { "value": { "values": [ "frequent" ] }, "attachments": [] }, "nearmissfld-actiontaken": { "value": { "values": [ "immediate-change" ] }, "attachments": [], "fups": [ { "id": "sk8jdfalkjwkljdfa72s", "open": true, "due": null, "created_on": 1557242948124, "updated_on": 1557242948124, "resolved_on": null, "m_observer_id": "5804f0f40ef50473af5870e6", "m_assigner_id": "5804f0f40ef50473af5870e6", "m_assignee_id": "5804f0f40ef50473af5870e6", "m_completer_id": null, "messages": [ { "id": "5w3jdoklkjwkljdfawm9", "date": 1557242948124, "m_user_id": "5804f0f40ef50473af5870e6", "m_reassignee_id": null, "signature": null, "attachments": [], "notify": false, "note": "Hey - can you fix this?" } ] } ] }, "nearmissfld-managementofhazard": { "value": { "values": [] }, "attachments": [] }, "nearmissfld-description": { "value": { "text": "This is a sample answer for the paragraph input 1" }, "attachments": [] }, "nearmissfld-attachments": { "value": { "attachments": [ { "key": "modules/create-customer/fake-data/client/response-attachments/road-washout.jpg" }, { "key": "modules/create-customer/fake-data/client/response-attachments/cracked-metal.jpg" }, { "key": "modules/create-customer/fake-data/client/response-attachments/broken-pipe.jpg" } ] }, "attachments": [] } }, "fups": [ { "id": "sk8jdfalkjwkljdfa72s", "open": true, "due": null, "created_on": 1557242948124, "updated_on": 1557242948124, "resolved_on": null, "m_observer_id": "5804f0f40ef50473af5870e6", "m_assigner_id": "5804f0f40ef50473af5870e6", "m_assignee_id": "5804f0f40ef50473af5870e6", "m_completer_id": null, "messages": [ { "id": "5w3jdoklkjwkljdfawm9", "date": 1557242948124, "m_user_id": "5804f0f40ef50473af5870e6", "m_reassignee_id": null, "signature": null, "attachments": [], "notify": false, "note": "Hey - can you fix this?" } ] } ] } } }
Errors
If an error occurs, the response JSON will have ok
set to false
:
{ "ok": false, "error": "token_invalid", "description": "The token `YOUR_TOKEN` was not found." }
The error
field will contain one of the following error identifiers and there
may also be a description field with a more detailed explanation:
Identifier | Description |
---|---|
api_method_not_found |
The requested url did not match any KPA Flex API method. |
request_method_invalid |
The requested method was not GET or POST. |
request_data_invalid |
The request did not include a valid JSON request object. |
rate_limit_exceeded |
This token is exceeding its request limit. |
token_missing |
The request did not include a token. |
token_invalid |
The request token was invalid. |
token_inactive |
The request token was has been deactivated. |
token_permission |
The request token does not have write permission. |
account_inactive |
The request token was for an account that is not active. |
parameter_unexpected |
The request data included a parameter that is not supported. |
parameter_missing |
The request data failed to include a parameter which was required. |
parameter_invalid |
The request data included a parameter which had a value that is not allowed. |
server_error |
The server encountered an internal error. |
content_not_found |
The requested content was not found. |