{"action":"created","issue":{"url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/75","labels_url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/75/labels{/name}","comments_url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/75/comments","events_url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/75/events","html_url":"https://github.com/annotationsatharvard/catcha/issues/75","id":121049288,"number":75,"title":"Report API Call Request: Total Num Given Course_id","user":{"login":"lduarte1991","id":6320787,"avatar_url":"https://avatars.githubusercontent.com/u/6320787?v=3","gravatar_id":"","url":"https://api.github.com/users/lduarte1991","html_url":"https://github.com/lduarte1991","followers_url":"https://api.github.com/users/lduarte1991/followers","following_url":"https://api.github.com/users/lduarte1991/following{/other_user}","gists_url":"https://api.github.com/users/lduarte1991/gists{/gist_id}","starred_url":"https://api.github.com/users/lduarte1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lduarte1991/subscriptions","organizations_url":"https://api.github.com/users/lduarte1991/orgs","repos_url":"https://api.github.com/users/lduarte1991/repos","events_url":"https://api.github.com/users/lduarte1991/events{/privacy}","received_events_url":"https://api.github.com/users/lduarte1991/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-08T16:49:21Z","updated_at":"2015-12-08T17:56:25Z","closed_at":null,"body":"@jmiranda Given our conversation about requesting api calls for reporting, here's the first request:\r\n\r\nGiven a call with course_id as a parameter I should get the total number of annotations:\r\n```\r\n{\r\n    course_id: fake_course_id, // to validate once returned\r\n    total_anno_num: 1500, // # of annotations WHERE course_id = fake_course_id\r\n    collections: [{\r\n        collection_id: fake_collection_id1,\r\n        total_anno_num: 300, // # of annotations WHERE collection_id=fake_collection_id1 AND course_id=fake_course_id\r\n        objects: [{\r\n            object_id: object_id1\r\n            total_anno_num: 25, // # of annotations WHERE course_id=fake_course_id AND collection_id=fake_collection_id1 AND object_id=object_id1\r\n        }, {\r\n            ...\r\n        }]\r\n    }, {\r\n       ...\r\n    }]\r\n}\r\n```\r\n\r\nIdeally 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.\r\n\r\ni.e.\r\n```\r\n/catch/annotator/report_totals?course_id=fake_course_id //returns 1500\r\n/catch/annotator/report_totals?course_id=fake_course_id&collection_id=fake_collection_id1 // returns 300\r\n/catch/annotator/report_totals?course_id=fake_course_id&collection_id=fake_collection_id1&object_id=object_id1 //returns 25\r\n```\r\n\r\nThe question is what does catch handle better? One call where I ask for everything or several calls where I ask for each part individually. "},"comment":{"url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/comments/162961827","html_url":"https://github.com/annotationsatharvard/catcha/issues/75#issuecomment-162961827","issue_url":"https://api.github.com/repos/annotationsatharvard/catcha/issues/75","id":162961827,"user":{"login":"jmiranda","id":1162935,"avatar_url":"https://avatars.githubusercontent.com/u/1162935?v=3","gravatar_id":"","url":"https://api.github.com/users/jmiranda","html_url":"https://github.com/jmiranda","followers_url":"https://api.github.com/users/jmiranda/followers","following_url":"https://api.github.com/users/jmiranda/following{/other_user}","gists_url":"https://api.github.com/users/jmiranda/gists{/gist_id}","starred_url":"https://api.github.com/users/jmiranda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmiranda/subscriptions","organizations_url":"https://api.github.com/users/jmiranda/orgs","repos_url":"https://api.github.com/users/jmiranda/repos","events_url":"https://api.github.com/users/jmiranda/events{/privacy}","received_events_url":"https://api.github.com/users/jmiranda/received_events","type":"User","site_admin":false},"created_at":"2015-12-08T17:56:25Z","updated_at":"2015-12-08T17:56:25Z","body":"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."}}