Skip to content

Post Endpoint

Sh Lin edited this page May 11, 2017 · 4 revisions

POST /api/posts (create)

Request

param type optional remarks
title string yes
author string yes
email string yes
message string conditional*
image file conditional*
parent_post_id integer yes
delete_password string yes
client_id string yes used to check if user owned the post
g-recaptcha-response string no google recaptcha response

*At least one of message or image should exists.

Response

Serialized post object or error message.

DELETE /api/posts

Request

param type optional remarks
id array of integers no
passwd string conditional*
del_pic boolean yes delete picture only

*Only admins can delete without passwd.

Response

Serialized post objects that have been destroyed.

GET /api/posts/search

Request

param type optional remarks
by_identity_hash string yes*
by_tripcode string yes*
by_client_id string yes*
by_title string yes*
by_author string yes*
by_email string yes*
by_message string yes*
lower_limit integer yes returned post id should be greater than this value
upper_limit integer yes returned post id should be smaller than this value
client_id string yes used to check if user owned the post

*Without by_ params, nothing will be returned.

Response

Array of posts without nested structure.