Redirect on second page of sis_imports?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am getting a redirect when I request the second page of sis_imports. Is this an issue with my request?
The initial request is:
curl -i https://ucmerced.test.instructure.com/api/v1/accounts/1/sis_import -H Authorization: Bearer <token>
This gets me a list of sis_imports encoded in JSON as desired. The Link header is:
Link: <https://ucmerced.test.instructure.com/accounts/1/sis_imports?page=1&per_page=10>; rel="current",<https://ucmerced.test.instructure.com/accounts/1/sis_imports?page=2&per_page=10>; rel="next",<https://ucmerced.test.instructure.com/accounts/1/sis_imports?page=1&per_page=10>; rel="first",<https://ucmerced.test.instructure.com/accounts/1/sis_imports?page=381&per_page=10>; rel="last"
However, when I request the next page, https://ucmerced.test.instructure.com/accounts/1/sis_imports?page=2&per_page=10, I get redirected:
HTTP/1.1 302 Found
Cache-Control: must-revalidate, no-cache, no-store, private, max-age=0
Content-Type: text/html; charset=utf-8
Date: Wed, 24 Jun 2015 15:22:54 GMT
Location: https://ucmerced.test.instructure.com/login
(etc.)
<html><body>You are being <a href="https://ucmerced.test.instructure.com/login">redirected</a>.</body></html>
This is happening in test, beta, and production. It is not occurring with any other APIs (that I recall), such as enrollments or courses.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Josh,
I ran into the same issue. api/v1/ does not get added to the pagination URLs in the header. I had talked to an engineer at InstructureCon and they fixed the issue but is still has not been reviewed to be added to the code base. In the meantime you could break the URL apart and insert api/v1/ and then run the API call.
Best,
Tyler Clair