Topic: API question

Posted under Tag/Wiki Projects and Questions

Hello, I'm making an app of e621 and I have a question about the Api.
I know that when sending the data to add a new image to the fav list we need to use this url, "https://e621.net/favorite/create.json" or ".xml" and that we need to send the username, password_hash and id of the image... But I don't know where to put them(Cookie?,Header?,POST data?)

Thnks for helping

Updated

Onelio said:
Hello, I'm making an app of e621 and I have a question about the Api.
I know that when sending the data to add a new image to the fav list we need to use this url, "https://e621.net/favorite/create.json" or ".xml" and that we need to send the username, password_hash and id of the image... But I don't know where to put them(Cookie?,Header?,POST data?)

Thnks for helping

make a call like this https://e621.net/favorite/create.json?login=username&password_hash=sha:hash

then write the post_id=123456 into the request body

Edit: don't forget to URLencode your request in case you run into problems

Updated by anonymous

But I get error 500 every time ._.

Url:
https://e621.net/favorite/create.json?login=Onelio&password_hash=***

Header:
Content-Type: application/json
accept-language: es-ES,es;q=0.8
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
path: /favorite/create.json?login=Onelio&password_hash=*****

And in the body,
post_id=901017

Doing something wrong?
Cookies maybe?

Updated by anonymous

Onelio said:
But I get error 500 every time ._.

Url:
https://e621.net/favorite/create.json?login=Onelio&password_hash=***

Header:
Content-Type: application/json
accept-language: es-ES,es;q=0.8
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36
path: /favorite/create.json?login=Onelio&password_hash=*****

And in the body,
post_id=901017

Doing something wrong?
Cookies maybe?

Please don't copy a browser user-agent for requests. please use a string containing your applications name, your user name, and your applications version looking something like My Awesome App/Version 1.0/Onelio

Other than that I can't see anything wrong right now :/

Updated by anonymous

rebane said:
Please don't copy a browser user-agent for requests. please use a string containing your applications name, your user name, and your applications version looking something like My Awesome App/Version 1.0/Onelio

Other than that I can't see anything wrong right now :/

I did that because the 500 error and using Chrome for testing, not in-app
Thanks for help.

Updated by anonymous

  • 1