Summary
This API request returns a list of all of the existing results for a specific campaign type on your site. For example, if you were to choose NPS as a campaign type, this API would return a list of all NPS results till date (for all of the NPS campaigns that you have launched in the past).
Resource URL
https://api.useriq.com/api/1.0/campaign/results_by_type?type=announcement
Resource Information
Request Type: GET
Response Format: JSON
Headers
- useriq-api-key (required): Your valid API key generated from the Site settings page
Parameters
- type - The type of campaign we want to get results for. (Options include one of: announcement, email, tooltip, tour, subtle, nps, survey)
- OPTIONAL page_number - The current page of results you're retrieving.
Example cURL Request:
curl \
-H "Content-type: application/json" \
-H "useriq-api-key: 572d7372829a3211a73d9c2cb790ffe3" \
https://api.useriq.com/api/1.0/campaign/results_by_type?type=announcement
Example Result
{
"results": [{ ... }, { ... }, ...],
"page":1,
"results_per_page":100,
"total_results":###
}
Response Codes
200: OK. Request processed successfully
400: Bad Request. API request could not be understood by the server.
401: Unauthorized. Invalid API access token.
Important Note
In the API response received, the below fields are reserved by UserIQ;
campaign_id,customer_user_id,visitor_id,action_taken,created_at,updated_at,last_step_seen,interaction,interaction_state,dismiss_origin,last_button_interaction, visitor_name, visitor_email
When you have a custom variable with the same name as the above resolved fields, you can expect the customer variable to be renamed with a postfix string “_cvar“ in the API response. E.g., if you have a custom variable called “customer_user_id”, this will be renamed to “customer_user_id_cvar” in the response.
Currently, when you have a customer variable such as eg; “customer_user_id”, it may conflict with the customer_user_id that UserIQ returns in the API response every time. Your “customer_user_id” may mean something different, therefore, in order to avoid issues with the custom variable without impacting our resolved “customer_user_id”, a postfix string “_cvar” is added.
Comments
0 comments
Please sign in to leave a comment.