List Activity Q&As
An overview of the List Activity Q&As endpoint.
Endpoint Description
Retrieve a list of the activities taken by users that are within your accessible companies (subscriptions) and view the questions and answers from the end of the activity. Data will only be available for activities that have a status of 'Activity Completed'.
HTTP Method
GET /api/v2/activities/company/{companyId}/questions
Request
Headers:
Content-Type:
application/json
- Specifies that the request body format is JSON.Accept:
application/json
- Indicates that the client expects a JSON response.Authorization:
Bearer {token}
- A valid Bearer token must be provided to authenticate the request.
URL Parameters
companyId (integer, required): The id of the company (subscription) to query user activity cards data. Inputting 0 will return activity cards data for all companies and users accessible by your bearer token. Example: 0
Query Parameters:
page (integer, required): Specifies the page number in the pagination sequence to retrieve a specific set of results.
limit (integer, required): Specifies the number of records to retrieve per page, controlling the volume of data returned.
maxDays (integer, optional): Filters the activities based on the number of days since the activity was taken. This is useful for querying recently taken activities.
userId (integer, optional): The R1 id of the user. If provided, returns all activities for this user in the specified company. Example: 1234
uniqueId (string, optional): The integration partner ID of the user. If provided, returns all activities for this user in the specified company. Example: ABComp-R1ID-0001234
userActivityId (integer, optional): The ID of a specific activity taken by a user. If provided, returns details for this single activity only. Example: 1234
activityType (integer, optional): The type of activity. 0 for all, 1 for Pyramid, 2 for Explore. Example: 0
topicId (integer, optional): The ID of the topic. If provided, returns all activities taken for this topic in the specified company. Example:
activityId (integer, optional): The ID of the activity. If provided, returns all activities taken for this activity in the specified company. Example:
sortby (integer, required): Specifies the order the users should be returned in:
1 - Sort by Oldest taken activity id
2 - Sort by Newest taken activity id
Request Examples
curl --request GET \
--get "http://r1discoverapi.local/api/v2/activities/company/1/questions?page=1&limit=50&maxDays=0&activityType=0&sortby=1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer {token}"
Response
Meta:
Each List endpoint will contain a meta element which will describe the returned package. In this endpoint, the meta will provide the following information:
total_items (Integer): The number of activities returned across all queried companies
total pages (integer): The number of pages returned in the call to the endpoint. (Total Items / per_page limit)
current_page (integer): Indicates the current page number of the results
per_page (integer): Indicates the number of results (topics) that will be listed on a single page. The default is 50, the limit is 100.
max_days (integer): Indicates the response data will include activities that have been taken within the indicated number of days going back from todays date.
company_id (integer): If specified, the id of the company queried for activities.
user_id (integer): If specified, the id of the user queried for activities.
user_activity_id (integer): If specified, the id of the specific single activity queried.
Data Dictionary:
user_activity_id (integer): The unique identifier for the user activity.
user_id (integer): The unique identifier for the user taking the activity.
company_id (integer): The unique identifier for the company the user aligned to for the activity.
questions (object): The collection of yes and no cards returned from the query.
question_id (integer): The id of questions asked of the user (1 means first question)
question (string): The text of the question asked of the user.
question_type (string): Indicates if it's a radio (select one), checkbox (select multiple), or a text based question
answer: The users answer to the question
Response Examples
{
"meta": {
"total_items": 109,
"total_pages": 3,
"current_page": "1",
"per_page": "50",
"max_days": "0",
"company_id": "2296",
"***comment": "UserId/ActivityId visible if included in query",
"user_id": "32579",
"user_activity_id": "276321"
},
"activities": [
{
"user_activity_id": 276321,
"user_id": 32579,
"company_id": 2296,
"questions": [
{
"question_id": 1,
"question": "What substance did you examine in this activity?",
"question_type": "radio",
"answer": "Alcohol – beer, wine, liquor, hard cider, hard seltzer"
},
{
"question_id": 2,
"question": "As you think about what you've learned and your results, which stage do you think you are in right now?",
"question_type": "radio",
"answer": "Contemplation"
},
{
"question_id": 3,
"question": "How long do you think you have been in this stage?",
"question_type": "radio",
"answer": "1 year"
},
{
"question_id": 4,
"question": "What will be the benefit for you and others as you change your pattern of behavior?",
"question_type": "textarea",
"answer": "Less consequences in my life, probably happier."
},
{
"question_id": 5,
"question": "What individuals, groups, or resources can you turn to for help and support?",
"question_type": "textarea",
"answer": "My support group and friends."
}
]
}
]
}
Postman Link
Notes
Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the endpoint.
Response Handling: Implement pagination to manage data effectively, especially when dealing with large datasets.
Last updated