Skip to main content

Using Chameleon’s API for Microsurvey responses, you can:
  • List Microsurvey responses.
  • Delete a Microsurvey response.

Schema

PropertyTypeDescription
idIDThe Chameleon ID
created_attimestampWhen this happened or when this was added to the Database
updated_attimestampThe last time any property was updated
survey_idIDThe Chameleon ID of the Microsurvey
profile_idIDThe Chameleon ID of the User Profile
hrefstringThe current page URL when the Microsurvey was displayed
button_textstringThe text of the button when clicked
button_ordernumberThe 0-indexed index of the button
button_idIDThe Chameleon ID of the button
input_textstringText comment left by the user (if configured) for Input Microsurveys 1st Step or Question 1 in the Follow Up Step
comment_step_input_text2stringText comment left by the user (if configured) for Question 2 in the Follow Up Step
dropdown_itemsstringFor a dropdown Microsurvey, the selected options from the dropdown on the 1st Step
other_textstringFor a dropdown Microsurvey, the alternative text comment left by the user (if configured)
comment_step_dropdown_itemsstringFor any kind of Microsurvey, the selected options from the Follow Up Step dropdown in Question 1
comment_step_other_textstringFor any kind of Microsurvey, the alternative text comment left by the user as the dropdown answer (if configured) in Question 1
comment_step_dropdown_items2stringFor any kind of Microsurvey, the selected options from the Follow Up Step dropdown in Question 2
comment_step_other_text2stringFor any kind of Microsurvey, the alternative text comment left by the user as the dropdown answer (if configured) in Question 2
comment_step_buttons_selectedstringFor any kind of Microsurvey, the selected option(s) from the Follow Up Step buttons in Question 1
comment_step_buttons_selected2stringFor any kind of Microsurvey, the selected option(s) from the Follow Up Step buttons in Question 2
finished_attimestampWhen the last step of Microsurvey response was completed
profileobjectAn expandable Profile model
profile.companynoneAn expandable Company model embedded in the profile

List Microsurvey Responses

HTTP Request

GET https://api.chameleon.io/v3/analyze/responses
param-description
idrequiredThe Chameleon ID of the Microsurvey
limitoptionalDefaults to 50 with a maximum of 500
beforeoptionalUsed when paginating, use directly from the cursor object from the previous response
beforeoptionalRead as “created before” and can be given as a timestamp or ID to get only limit items that were created before this time
afteroptionalRead as “created after” and can be given as a timestamp or ID to get only limit items that were created after this time
orderoptionalOne of created_at or updated_at. Defaults to created_at (the ID encodes this information).
expandoptionalObject that specifies relationships to include/exclude. Supported keys are profile and company
expand.profileoptionaluse values of all, min or skip to control the properties present in the profile. Defaults to min
expand.companyoptionaluse values of all, min or skip to control the properties present in the company. Defaults to min

Using the expand parameter

# As a URL parameter
expand[profile]=all&expand[company]=skip

# In the Reqeust body
{"expand":{"profile":"all","company":"skip"}}
Notes:
  • A profile key will always be present with an object value. The company (embedded within profile) will be missing when the User Profile is not attached to a Company, otherwise it will be an object.
  • The combination of before and after can be used to limit pagination to “stop” at your most recently cached Survey Response (send the max ID from your last import as the after parameter).

HTTP Response

{
  "responses": [
    {
      "id": "5f3c4232c712de665632a6d5",
      "href": "https://app.example.com/starting/page/1",
      "button_text": "Yes please 👍",
      "button_order": 3,
      "input_text": "I saw...",
      "finished_at": "2029-04-07T12:18:00Z",
      "profile": {
        "id": "5f3c4232c712de665632a6d5",
        "uid": "55232",
        ...
      },
      ...
    },
    {
      "id": "5f3c4232c712de665632a2a3",
      "href": "https://app.example.com/starting/page/2",
      "button_text": "No thanks 👎",
      "button_order": 2,
      "input_text": "I would have liked to see...",
      "finished_at": "2029-04-07T12:18:00Z",
      "profile": {
        "id": "5f3c4232c712de665632a6d6",
        "uid": "55125",
        "company": {
          "id": "5f3c4232c712de665632a6d7",
          "uid": "3321",
        },
        ...
      },
      ...
    },
    ...
  ],
  "cursor": {
    "limit": 50,
    "before": "5f3c4232c712de665632a2a3"
  }
}

Delete a Microsurvey Response

Deleting a Microsurvey response also clears the associated metrics and summaries

HTTP Request

DELETE https://api.chameleon.io/v3/edit/responses/:id
param-description
idrequiredA Response ID to remove
{
  "response": {
    "id": "5f3c4232c712de665632a2a1",
  }
}