Get a response
const url = 'https://api.getsitecontrol.com/v1/sites/1/responses/1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.getsitecontrol.com/v1/sites/1/responses/1 \ --header 'Authorization: Bearer <token>'One form response by id, with the same fields as in list_widget_responses. Call it when you hold a response id, e.g. from a response.created event. A response awaiting double opt-in or an e-mail check is not found until it is confirmed.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Response id from list_responses or list_widget_responses, or data.response.id of a response.created event subscription payload
Response id from list_responses or list_widget_responses, or data.response.id of a response.created event subscription payload
Responses
Section titled “Responses”object
Response number, when the widget numbers its responses
When the response was sent
Set asynchronously; may be null on a fresh response
Answers by field name, in the order of the widget’s current form. Options removed from the form since the response are left out.
object
object
Type of a form field, as the editor offers it (email, text, textarea,
hidden, select, radio, rating, nps and the ones below). tel: a plain phone
input; phone: one with a country selector; flag: a single checkbox;
checkbox: a group of checkboxes; reveal, scratch, wheel: games; the
answer is the drawn prize, its name is the prize code; other: any other
field, or one the widget’s current form no longer describes.
Visitor parameters as set on the site: arbitrary JSON that may hold personal data
Page the response was sent from, with its query string, which may hold e-mails or tokens
Query parameters of page_url, the last value of a repeated key; may hold e-mails or tokens
object
Previous page of the visit on the site, not the external source; with its query string
Page the visit came from, as the browser reported it on the visit’s first page: usually another site, with its query string; null for a direct visit
object
object
object
Fields are null when the site is not on a known platform
object
The site’s e-commerce platform, e.g. shopify; null elsewhere
The platform’s id of a signed-in customer
The platform’s order id, on an order status page
Empty unless the response could not be read; wording is not stable, do not parse
{ "fields": { "additionalProperty": { "type": "email" } }}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Authentication scheme: Bearer
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
response_not_found: no such response on the site, it is deleted or not confirmed yet. A response being completed may give it briefly; retry the request
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
rate_limited: the key, account or heavy bucket is spent; this operation spends the heavy bucket shared with statistics and other heavy calls
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds
Seconds until the bucket refills
The documented shape of every error body on the versioned surface.
object
object
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "reason": "example", "next": "example", "request_id": "example", "errors": [ { "loc": [ "example" ], "msg": "example", "type": "example" } ], "metadata": {}}Headers
Section titled “Headers”API version the response was produced for
Request id, echoed from the request when valid
Limit of the tightest bucket
Requests left in its window
End of its window, epoch seconds