View Taken Activity Questions & Answers

An overview of the View Taken Activity Questions & Answers endpoint.

Endpoint Description

The View Taken Activity Questions & Answers endpoint retrieves user responses to questions associated with a specific activity.

HTTP Method

GET /api/v1/view-taken-activity-questions-answers/{userActivityId}

Headers

  • Content-Type: application/json

  • Accept: application/json

  • Authorization: Bearer {token}

URL Parameters

  • userActivityId (integer): The unique identifier of the taken activity. This parameter is required to specify the activity whose question and answer data is being queried.

Data Dictionary for Response Fields

The response for the "View Taken Activity Questions & Answers" endpoint includes detailed information about each question and the corresponding user response for a specific activity. Below is a breakdown of each field in the response data:

  • user_activity_id (integer): Unique identifier for the user activity.

  • questions (array): Collection of questions and answers for a particular user activity.

    • question_id (integer): Unique identifier for a question within the activity. Distinct to activity, not across the system.

    • question_type (string): The format a question is presented to the user. This influences the structure of the response data.

    • question (string): The question asked to the user.

    • answer (string): The user response to the question, can be a string or an array containing strings.

Request Examples

curl --request GET \
    --get "https://api.r1learning.com/api/v1/view-taken-activity-questions-answers/11" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"

Response Examples

{
  "error": 0,
  "message": "",
  "userActivityId": 1170,
  "data": {
    "id": 1170,
    "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": "not sure"
      },
      {
        "question_id": 5,
        "question": "What individuals, groups, or resources can you turn to for help and support?",
        "question_type": "textarea",
        "answer": "not sure"
      }
    ]
  }
}

Notes

  • Authorization Required: Ensure the provided Bearer token is valid and has sufficient privileges to access the user activity question and answer data.

  • Response Handling: Paginate responses to manage data effectively, especially when dealing with large datasets.*

Last updated