Allow requests to "expand" links #141
Labels
Type: Documentation
Issue related to documentation
Type: Enhancement
Improvements existing features or code
Milestone
In order to provide a better API consumer experience when using applications like Zapier we should provide a way to "expand" related objects on various API resources.
For example, when retrieving information about a student enrollment many API consumers may want information about the related post or student (or both).
With an "expand" parameter consumers may specify which resources should be expanded and we could add these resources to the return.
An example response is currently:
An expanded response could add expanded resources as follows:
I think that essentially any resource which references another resource could utilize and "expanded" request parameter.
Stripe's API expands items inline, however since most of our endpoints respond with "student_id" instead of "student" I don't think it makes semantic sense to add an object to a property that has "_id" in the name.
The Rebilly API handles things more the way I think we should: https://rebilly.github.io/RebillyAPI/#section/Expand-to-Include-Embedded-Objects
I do, however, like the way Stripe allows you to recursively request expanded objects. This would be useful on the Student Progress api. If, for example, you're consuming progress updates about a lesson you could expand the
post
as well as that lesson's parent course via thecourse_id
property.The text was updated successfully, but these errors were encountered: