Notice: My personal stance on AI generated artwork. Retweet and share if you agree. Let us discuss, and not immediately scream bloody murder.

Now Viewing: Comment API
Keep it civil, do not flame or bait other users. If you notice anything illegal or inappropriate being discussed, contact an administrator or moderator.

Makentoshe - Group: Member - Total Posts: 2
user_avatar
Comment API
Posted on: 08/26/17 09:28AM

Is there any comment-API access for creating a comments? I tryed create POST request for
/index.php?page=comment&id=_id_&s=save but csrf-token was always invalid. Have you any ideas for resolve this problem?



Jerl - Group: The Real Administrator - Total Posts: 6704
user_avatar
Posted on: 08/26/17 12:33PM

You need to provide your CSRF token to post comments (or tag edits, or anything that changes the site). You can get the CSRF token from the comment submit form. It'll be a hidden form element called "csrf-token".

You will also need to submit all of the login cookies that match that token: user_id, pass_hash, and PHPSESSID. If you submit a different PHPSESSID cookie, it won't work. In other words, you can't just copy the CSRF token from your browser into your program and expect it to work.



Makentoshe - Group: Member - Total Posts: 2
user_avatar
Arigatou
Posted on: 08/26/17 01:08PM

Thank you, i did it! And of course I forget about PHPSESSID cookie. Thanx for your advice



add_replyAdd Reply


1