Get the current term id

Jump to solution
rancho
Community Member

Hello again

I want to thank everyone for all their help so far.  I am running a report through the API, but it returns data for all the terms.  I know how to put the term id in to the request to restrict it.  But I am not sure about the best way to know what the current term is.  After a little digging around I found the Enrollment Term API.  But there is not an endpoint for current term.  So I was thinking of using the list all terms (/api/v1/accounts/self/terms) and then finding the max id value. For our institution it looks like that is the way it works. Can I count on that or is there a better way?

cheers

bob

 

Labels (2)
0 Likes
2 Solutions
matthew_buckett
Community Contributor

You can get the current term with:

https://instance.instructure.com/api/v1/accounts/self/terms/current

This is outlined in the objects IDs documentation however it doesn't work if there's more than one currently active term.

View solution in original post

0 Likes
rancho
Community Member
Author
0 Likes