A potential API bug was reported by hollyw when using the “Get a public list of users” endpoint with paging. The load_more_directory_items field in the response meta did not include the .json extension, causing the next page request to return HTML instead of JSON. hollyw noted that the issue was not with the initial API call, which did specify .json, but with the load_more_directory_items value not including .json.
I was just doing some testing with the “get public list of users” endpoint and needed to do paging to get the remaining users. I used the load_more_directory_items field to get the path for the next page, which was listed as /directory_items?order=days_visited&page=1&period=all
However, when using this path, I didn’t get a proper API response with users, and instead just got some HTML. I compared it to the original endpoint and it looks like it’s missing the .json after directory_items. Adding the .json to the path for the next page appeared to work. Would this be an API bug?
When using the API please always use .json for any api requests because while most endpoints will return json by default some will return html. Looks like this route doesn’t have a default though, so when it didn’t get passed .json the route couldn’t be found.
You really should be specifying .json so you don’t get this error page, but I wonder if we do detect an API call if we should return an actual 404 http response instead of 200 with an unreadable html body ?
Right, with the endpoint in the initial API call I am specifying .json. The issue I was noting was that in the response, the load_more_directory_items under meta did not specify .json.