HapYak Reporting API

Common Parameters

key

API write key for HapYak partner. This can be found in your account settings page.

start

Scopes the report to events after the specified date (inclusive). Example, 10/1/13

end

Scopes the report to events before the specified date (inclusive). Example, 10/3/13.

project

Scopes the report to a specific project.

track

Scopes the report to a specific track.

callback

Wraps the response in JSONP callback.

End Points

Quiz Actions By Track

Per track breakdown of quiz actions.

Endpoint: /api/reports/projects/quiz/actions

Response Format

{
    "data": [
        {
            "actions": 45,          // total actions
            "track": {              // track data
                "id": 5779,
                "title": "Click here to visit our site"
            }
        }
    ]
}

Quiz Summary

Breakdown of quiz responses.

Endpoint: /api/reports/quiz/project/summary

Response Format

{
    "data": [
        {
            "question": "What is the capital of Massachusetts?",
            "num_correct": 6,                   // total correct responses
            "num_responses": 14,                // total num responses
            "answers": [                        // by answer breakdown
                {
                    "answer": "Watertown",
                    "correct": false,           // incorrect answer
                    "num_responses": 6,
                    "percent": 43.0
                },
                {
                    "answer": "Boston",
                    "correct": true,           // correct answer
                    "num_responses": 6,
                    "percent": 43.0
                },
                {
                    "answer": "Los Angeles",
                    "correct": false,
                    "num_responses": 2,
                    "percent": 14.0
                }
            ]
        },
    ]
}

Gradebook Summary

Break down of correct/incorrect answers per user.

Endpoint: /api/reports/gradebook/summary

Response Format

{
    "num_questions": 234,                   // total number of questions
    "users": [
        {
            "username": "Bilbo Baggins",
            "num_correct": 8,
            "num_incorrect": 2,
            "num_responses": 10,
            "user_id": "340990342"
        }
    ]
}

Gradebook Answers

List of specific answers for users.

Endpoint: /api/reports/gradebook/users/answers?gradebook_user=[user_id]

Parameters

gradebook_user

Filters the gradebook answers to a specific user.

Response Format

{
    "users": [
        {
            "questions": [
                {
                    "answer": "Google search",
                    "correct": true,
                    "date": "2013-11-06 05:47 PM",
                    "question": "How did you hear about this video?"
                }
            ],
            "user": {
                "user_id": "340990342",
                "username": "Bilbo Baggins"
            }
        }
    ]
}

Usage

Returns total number of projects, annotations, and a count per annotation type.

Endpoint: /api/reports/usage

Response Format

{
    "counts": [
        {
            "count": 7,
            "type": "pop"
        },
        {
            "count": 1,
            "type": "contents"
        },
        {
            "count": 1,
            "type": "bookmark"
        },
        {
            "count": 1,
            "type": "image"
        },
        {
            "count": 1,
            "type": "drawing"
        }
    ],
    "num_annotations": 11,
    "num_projects": 0
}