Overview
The Activity API is called with identifiers for a respondent and a time range in hours. This guide shows how to send the request withPOST, passing the parameters as a JSON body. All parameters are optional.
Unlike the search and review APIs, the Activity API runs on resdefio.com and is authorized with an authorization key that you send in the x-api-key header.
Authentication
Send your authorization key in thex-api-key header of every request.
string
required
Your Research Defender authorization key.
Endpoint
string
POST https://{environment}.resdefio.com/activity
In the sample, set
ENVIRONMENT to "prod" or "stage".
Request body
Send the parameters as a JSON object. All parameters are optional.string
The survey number. Optional.
string
The respondent’s session ID. Optional.
string
The panel ID. Optional.
string
The respondent’s hashed email address. Optional.
number
default:"24"
The time range in hours. Optional. If you leave it out,
24 is used.Range values
Range accepts one of these values, in hours.
Sending more parameters
The sample sendsSurvey_Number and Session_Id. To send Panel_Id, Hashed_Email, or Range, add them to the object in buildPayload(). A request body with every parameter looks like this:
Example
- JavaScript
- cURL
activity-post.js
buildPayload(), which leaves out empty values. getActivity() sends the request with the Content-Type and x-api-key headers and shows the API’s message if the request fails.
Full HTML page
If you want a complete page you can open in a browser, use the sample below. Replace the placeholder values at the top of the script.Activity integration with POST (HTML)
Activity integration with POST (HTML)
activity-post-integration.html
