post #9000000 GET!
Danbooru

Posts API is broken

Posted under General

Requests to /post/index.json and /post/index.xml are both returning 403s with empty responses. Other actions within post and other section's indexes appear to be working.

I don't use Danbooru myself, but one of my users reported problems yesterday. So, I'm not sure how long this has been the case.

Updated by Akiraka8

ghostrigger said:
works fine for me. be sure you are logged in and you passed your authentication credentials. anonymous access to the api is no longer supported.

The good news is I got it working! I don't entirely understand the problem, though.

I checked on the login issue by manually entering a URL into the API in my browser and comparing that to what the script was outputting. I found that in this particular situation the API would return output whether or not I included the authentication credentials. Maybe that's because it's a read-only API request?

What I noticed was that the URL being generated from an MD5 hash in the image (I think from EXIF data) wasn't matching the filename stored on Danbooru, so the URL timed out. When I changed the script to use the portion of the filename before the extension it started working again. The script had worked fine, and it never changed until now. Maybe there was a minor tweak in the API that caused it to stop working the old way.

1