Topic: [Bug] Voting and favoriting by API doesn't seem to work

Posted under Site Bug Reports & Feature Requests

Bug overview description.
I'm trying upvoting and favoriting posts by API and I can't for some reason.
What part(s) of the site page(s) are affected?
JSON API (and XML API for upvote)
What is the expected behavior?
https://e621.net/favorite/create.json?login=Granberia&password_hash=correct_hash&id=1541656 - favorite post #1541656

https://e621.net/post/vote.json?score=1&login=Granberia&password_hash=correct_hash&id=1541656 - upvote post #151541656

What actual behavior is given instead?
First request - 400 error
Second request - 404 error. In browser it is redirected to https://e621.net/post/show?id=%23%3CProc%3A0x00000004cab828%40%2Fhome%2Fe621%2Fe621-production%2Freleases%2F20160126060000%2Fapp%2Fcontrollers%2Fpost_controller.rb%3A8+%28lambda%29%3E
Time of incident (if applicable).
Today
Can you reproduce the bug every time?
Yep.
What steps did you take to replicate this bug?
Tried both python script and directly in browser.
Errors or other messages returned (if any).
First request - 400 error
Second request - 404 error

Updated by Fisk24

Have you tried using POST method? It'll burp on browser's address bar since it actually makes a GET request.

Edit: For the record, when requests change details of posts (ex. score, fav status, flags) you'll have to POST instead of GET.

The 400 tell you this, actually, as that means you made a Bad Request

Also, nice example, btw

Updated by anonymous

Xch3l said:
Have you tried using POST method? It'll burp on browser's address bar since it actually makes a GET request.

Edit: For the record, when requests change details of posts (ex. score, fav status, flags) you'll have to POST instead of GET.

The 400 tell you this, actually, as that means you made a Bad Request

Also, nice example, btw

I checked, and it's the reason. Thanks.

Updated by anonymous

I am actually having a similar issue here. I'm getting a 423 error and i'm quite sure I'm using POST.

Updated by anonymous

Actually I just checked my favorites and the post was indeed added. But why the 423 error? Should I just compensate for this response or am I doing something wrong?

Updated by anonymous

Oh my gosh, ok. It was because i had already managed to favorite it at some point. Noted though, now i know how to tell if a post is already favorited.

Updated by anonymous

  • 1