Activity & User Logs

The logs/pathway-logs endpoint retrieves activities and user logs. Pathway logs provides a comprehensive log of each activity and each user log. Pathway activities are related to various content, off and on app activities.

Before working with this endpoint it is suggested to read through Activity & Fulfilment Types. This will give you a insight into how pathway logs work and what fulfilment references are available. Limits Due to number of users that could be enrolled on a pathway this endpoint is limited to 1 pathway being returned. If you need to query multiple pathways you will need to do multiple requests.

Parameters

The logs/pathway-logs endpoint has several parameters allowing you to filter by pathway, users, activities, activity types or a combination of all 4. This allows retrieving specific activities and user logs.

Key

Type

pathway

String (ID or name of pathway)

activities

Array String (ID or name of activity)

types

Array String (Type of activity)

groups

Array Sting (name of group)

users

Array String (name or email)

Examples

The examples below do not exhaust what is possible, but will give a good overview of different techniques and approaches.

Get All Activities & Logs

The example below will retrieve all activities and logs for a pathway. This is useful if you wish to see all logs from users and get an overall progress for a pathway.

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    pathway : "Pathway A"
  }'

Get Specific Activity Type & Logs

The example below will retrieve only Data Tracking activities and logs for a pathway. This is useful if you would like to get a an overview of just Data Activities and their results.

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "types" : ["Data Target"]
  }'

Get Specific Activity Types & Logs

The example below will retrieve several different activity types and logs for a pathway. This is useful if you want to get activities and logs of different types.

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "types" : ["Data Target","Certificates","Stories",...]
  }'

Get Specific OR Multiple Users & Logs

The examples below will retrieve all log for a single user or multiple users for a pathway. With the users parameter you can search by email, first name, last name or full name. Remember you can use types along with users to filter user logs to specified activity types.

Specific User

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "users" : ["joe.soap@example.com"]
  }'

Multiple Users

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "user" : ["joe.soap@example.com","user.two@example.com",...etc],
    "types" : ["Data Target","Assessments","Stories",...]
  }'

Get Specific OR Multiple Activities & Logs

The examples below will retrieve all log for a single activity or multiple activities for a pathway. With the activities parameter you can search by name or ID of an activity.

Single Activity

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "activities" : ["Story A"]
  }'

Multiple Activities

curl -X POST \
  v1/logs/pathway-logs \
  -H 'Authorization: Basic <Your Base64 Encoded Token>'
  -d '{
    "pathway" : "Pathway A",
    "activities" : ["Story A","Video A","Audio A",..etc]
  }'

Tip You can use a combination of types, activities & users to retrieve what ever logs are needed.

Success Response

A successful response will return a pathway + activities item array.

{
    "status": "success",
    "data": [
        {
            "pathway": {
                "name": "Become A Store Owner",
                "type": "pathway",
                "ID": "EV67-ZCNS-56AD"
            },
            "activities": [
                {
                    "ID": "EVPA-WVZF-56QJ",
                    "name": "Data Tracking",
                    "type": "data",
                    "fulfilmentType": "tracking",
                    "required": true,
                    "level": 1,
                    "stats": {
                        "total": 2,
                        "completed": 2
                    },
                    "logs": [
                        {
                            "firstname": "User",
                            "lastname": "One",
                            "email": "user.one@example.com",
                            "telephone": "",
                            "country": "South Africa",
                            "city": "Cape Town",
                            "groups": [
                                "Group A",
                                "Group B"
                            ],
                            "status": {
                                "complete": true,
                                "progress": 100,
                                "state": "completed",
                                "timestamp": "2022-02-24T15:09:57+02:00"
                            },
                            "fulfilment": {
                                "type": "data",
                                "state": "completed",
                                "progress": 100,
                                "data": {
                                    "category": "Current Score",
                                    "current": 500,
                                    "target": 159
                                },
                                "timestamp": "2022-02-24T15:09:57+02:00"
                            }
                        },
                        ...etc 
                    ]
                },
                {
                    "ID": "EVPA-KWOI-80AI"
                    "name": "Story A",
                    "type": "story",
                    "fulfilmentType": "complete",
                    "required": true,
                    "level": 1,
                    "stats": {
                        "total": 2,
                        "completed": 1
                    },
                    "logs": [
                        {
                            "firstname": "User",
                            "lastname": "One",
                            "email": "user.one@example.com",
                            "telephone": "",
                            "country": "South Africa",
                            "city": "Cape Town",
                            "groups": [
                                "Group A",
                                "Group B"
                            ],
                            "status": {
                                "complete": true,
                                "progress": 100,
                                "state": "completed",
                                "timestamp": "2022-02-24T14:56:56+02:00"
                            },
                            "fulfilment": {
                                "type": "story",
                                "state": "completed",
                                "progress": 100,
                                "story": {
                                    "ID": "EV72-RQZY-80AH",
                                    "name": "Story A",
                                    "score": 100
                                },
                                "timestamp": "2022-02-24T14:56:56+02:00"
                            }
                        },
                        ..etc
                    ]
                },
                ...etc
            ]
        }
    ],
    "hash": "bcce5ca8f5ea870a16f43c411136be31",
    "response_time": 0.22242403030395508
}

Pathway + Activities Item

Key

Type

pathway

Object

pathway.ID

String (ID / SKU of the pathway)

pathway.name

String

activities

Array of Activity Items

Activity Item

The activity item contains information about the activity and logs which provides all user logs.

Key

Type

ID

String (ID / SKU of the activity)

name

String

type

Enum (Activity type see references)

fulfilmentType

Enum (Fulfilment type see references)

required

Bool (If the activity is required)

level

Int (The level the activity is on 1 - 4)

stats

Object

stats.total

Int (Number of users)

stats.completed

Int (Number of users completed this activity)

logs

Array of Log Items

Log Item

The log item contains user information, status and fulfilment. Status contains basic log information such as complete, state, timestamp & progress. Fulfilment has the same information as status but includes specific fulfilment data that relates to the activity.

Depending on what information is needed and your use case. You should use status if you do not need fulfilment data, otherwise use fulfilment to access status and fulfilment data. To understand fulfilment data and what's available see Fulfilment References.

Key

Type

firstname

String

lastname

String

email

String

telephone

String

country

String

city

String

groups

Array (String of groups)

status

Object

status.complete

bool (If the user completed the activity)

status.state

Enum (not started, in progress, completed)

status.timestamp

String (Last updated / completed time)

status.progress

Float (User progress on the activity)

fulfilment

Last updated