ThoughtMetric

Orders and surveys

Survey results

GET https://thoughtmetric.io/api/v1/survey_results

Responses to the post-purchase “how did you hear about us” survey, along with the order count over the same window so you can calculate a response rate.

Example request

curl -G https://thoughtmetric.io/api/v1/survey_results \
  -H "Authorization: Bearer 2019962dcf7a7b1fedc4563b9aaf9fc87426f278" \
  -d projectId=ID-bcd0aa692ce7e6b2 \
  -d startDate=2024-01-01 \
  -d endDate=2024-01-31 \
  -d interval=day

Query parameters

projectId string, required The Project ID of the store you are querying, e.g. ID-bcd0aa692ce7e6b2. Find it under Configure → API in the dashboard. The older numeric project ID is also accepted.
startDate string, required Start of the reporting window, YYYY-MM-DD. Inclusive.
endDate string, required End of the reporting window, YYYY-MM-DD. Inclusive. The window may not exceed six months.
interval string, required Bucket size for the over_time series: day, week, month or year.

Response

total number

Total survey responses in the window.

total_orders number

Orders placed in the window, counted from the date your first survey response was recorded. Use this as the denominator for a response rate.

total_by_channel array

One object per survey answer.

channel_result string The answer the customer selected.
surveys number Number of responses with this answer.

Example response

200 OK
{
  "total": 412,
  "total_orders": 1284.0,
  "total_by_channel": [
    { "channel_result": "Instagram", "surveys": 148 },
    { "channel_result": "Friend or family", "surveys": 96 },
    { "channel_result": "Google search", "surveys": 88 },
    { "channel_result": "Podcast", "surveys": 80 }
  ]
}

Notes

  • interval is required by the API but does not affect the result.