AnsweredAssumed Answered

Getting the Module ID from Module Item ID. Chicken vs Egg...

Question asked by Jonny Sagorin on Aug 6, 2017
Latest reply on Aug 6, 2017 by Jonny Sagorin

Hi,

 

Given a URL of this format, does anyone have suggestions on how to get the module ID from a module item ID? 

https://rmit.instructure.com/courses/123456/pages/my-page-slug-here?module_item_id=123456

 

I'd like to query the API for additional information on the module item, but to do so, I need the module ID:

 

 

Show module item ID

GET /api/v1/courses/:course_id/modules/:module_id/items/:id

 

The only way I know of doing this is:

- API query the course for all its modules

- for each module, API query for its module items until there is a match on a module item ID. At this point, I have the module Id

 

This approach is inefficient, but perhaps the only way?

 

Any suggestions on a  better, more efficient solution?

 

Thanks!

Outcomes