Skip to content

Instantly share code, notes, and snippets.

@kirillrocks
Created October 29, 2017 10:05
Show Gist options
  • Select an option

  • Save kirillrocks/2ebf00c2df8f9065e7d7d54f6348c30b to your computer and use it in GitHub Desktop.

Select an option

Save kirillrocks/2ebf00c2df8f9065e7d7d54f6348c30b to your computer and use it in GitHub Desktop.
#### Links ####
* wp-json/cjra/v1/posts
* wp-json/cjra/v1/videos
#### Arguments ####
* offset
* per_page (default 10)
* category (ID of categories for posts)
#### Examples ####
* wp-json/cjra/v1/posts?per_page=5&offset=2
* wp-json/cjra/v1/videos?per_page=1&offset=1
* wp-json/cjra/v1/videos?action=get_most_liked&time_from=`{UNIX TIMESTAMP}`&time_to=`{UNIX TIMESTAMP}`&limit=`{(int) LIMIT}`
* wp-json/cjra/v1/videos?action=like&post_id=`{(int) POST ID}`&user_ip=`{USER IP}`
* wp-json/cjra/v1/videos?action=dislike&post_id=`{(int) POST ID}`&user_ip=`{USER IP}`
* wp-json/cjra/v1/videos?action=get_post_likes&post_id=`{(int) POST ID}`
#### Response ####
1. wp-json/cjra/v1/posts?per_page=1
* "id": 1178
* "title": Title Here
* "content": Content Here
**Images links with placeholders like a key**
* "content_images": {
plc-0: src link here,
plc-1: src link here
}
**Content with placeholders**
* "temp_content": "plc-0 \r\n plc-1 \r\n other content here"
* "author": author display name,
* "timestamp": 1357935739,
* "permalink": src link here,
* "image": src link here or null,
* "image_width": image width here or null,
* "image_height": image height here or null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment