Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report API Call Request: Total Num Given Course_id #75

Open
lduarte1991 opened this issue Dec 8, 2015 · 2 comments
Open

Report API Call Request: Total Num Given Course_id #75

lduarte1991 opened this issue Dec 8, 2015 · 2 comments

Comments

@lduarte1991
Copy link

@jmiranda Given our conversation about requesting api calls for reporting, here's the first request:

Given a call with course_id as a parameter I should get the total number of annotations:

{
    course_id: fake_course_id, // to validate once returned
    total_anno_num: 1500, // # of annotations WHERE course_id = fake_course_id
    collections: [{
        collection_id: fake_collection_id1,
        total_anno_num: 300, // # of annotations WHERE collection_id=fake_collection_id1 AND course_id=fake_course_id
        objects: [{
            object_id: object_id1
            total_anno_num: 25, // # of annotations WHERE course_id=fake_course_id AND collection_id=fake_collection_id1 AND object_id=object_id1
        }, {
            ...
        }]
    }, {
       ...
    }]
}

Ideally making this one call would be best, though if in the meantime there's one call where I send a request per item that I want, that would be fine too.

i.e.

/catch/annotator/report_totals?course_id=fake_course_id //returns 1500
/catch/annotator/report_totals?course_id=fake_course_id&collection_id=fake_collection_id1 // returns 300
/catch/annotator/report_totals?course_id=fake_course_id&collection_id=fake_collection_id1&object_id=object_id1 //returns 25

The question is what does catch handle better? One call where I ask for everything or several calls where I ask for each part individually.

@jmiranda
Copy link
Contributor

jmiranda commented Dec 8, 2015

Thanks @lduarte1991. I'll give it some thought, but I think one call is fine as long as the data returned is related to the request. However, I don't know if I like the aggregation of "collections" under the root. That could become really expensive if there are lots of collections and lots of objects. And do we actually use course_id yet? I don't remember adding that as an indexed field.

@lduarte1991
Copy link
Author

@jmiranda oh actually... course_id is supposed to be context_id, I conflated the terms. And well it will be really expensive either way cause I will either make one call with all those items or a bunch of smaller calls all at once.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants