Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

GET /blog

Browse blogs

Example URI

http://example.com/restful_api/blog?search[search]=Bermuda&limit=10&page=1

Parameters

ParameterTypeRequire ?Description
search[search]stringnoKeyword for searching
user_idnumbernoBrowse by owner id
sortstringnoSupport sort return results
limitnumbernoLimit return results
pagenumbernoPaging return results
item_idnumbernoSupport search blogs on item (pages/groups)
module_idstringnoSupport search blogs on item (pages/groups)
categorynumbernoSupport search blogs by category id
tagstringnoSupport search blogs by tags
viewstringnoSupport some view mode: spampendingmydraft

Response

 {
  "status": "success",
  "data": [
    {
      "text": "The Bermuda Triangle, also known as the Devil's Triangle, is a loosely-defined region in the western part of the North Atlantic Ocean, where a number of aircraftand ships are said to have disappeared under mysterious circumstances. Most reputable sources dismiss the idea that there is any mystery. The vicinity of the Bermuda Triangle is one of the most heavily traveled shipping lanes in the world, with ships frequently crossing through it for ports in the Americas, Europe, and the Caribbean islands. Cruise ships and pleasure craft regularly sail through the region, and commercial and private aircraft routinely fly over it.\r\n\r\nPopular culture has attributed various disappearances to the paranormal or activity by extraterrestrial beings. Documented evidence indicates that a significant percentage of the incidents were spurious, inaccurately reported, or embellished by later authors.",
      "user_id": "1",
      "blog_id": "5",
      "title": "Bermuda Triangle",
      "time_stamp": "1481594689",
      "time_update": "1481594990",
      "is_approved": "1",
      "privacy": "0",
      "post_status": "1",
      "total_comment": "0",
      "total_attachment": "0",
      "total_view": "0",
      "total_like": "0",
      "module_id": "blog",
      "item_id": "0",
      "categories": [],
      "tag_list": ""
    }
  ],
  "messages": []
}

POST /blog

Post new blog

Example URI

http://example.com/restful_api/blog

Parameters

ParameterTypeRequire ?Description
val[title]stringyesBlog title
val[text]stringyesBlog text
val[categories]arraynoBlog categories
val[privacy]numbernoLimit return results
val[tag_list]stringnoTags list for the blog
val[publish]booleannoPublish blog
val[draft]booleannoSave blog as draft
val[module_id]stringnoSupport post blog on item (pages/groups...)
val[item_id]stringnoSupport post blog on item (pages/groups...)

Response

{
  "status": "success",
  "data": {
    "blog_id": "7",
    "user_id": "1",
    "title": "Santa Claus",
    "time_stamp": "1481596113",
    "time_update": "0",
    "is_approved": "1",
    "privacy": "0",
    "post_status": "1",
    "total_comment": "0",
    "total_attachment": "0",
    "total_view": "0",
    "total_like": "0",
    "module_id": "blog",
    "item_id": "0",
    "text": "Santa Claus, also known as Saint Nicholas, Saint Nick, Kris Kringle, Father Christmas, or simply Santa (Santy in Hiberno-English), is a legendary figure of Western culture who is said to bring gifts to the homes of well-behaved ("good" or "nice") children on Christmas Eve (24 December) and the early morning hours of Christmas Day (25 December). The modern Santa Claus grew out of traditions surrounding the historical Saint Nicholas, a fourth-century Greek bishop and gift-giver of Myra, the British figure of Father Christmas, the Dutch figure of Sinterklaas (himself based on Saint Nicholas), the German figure of the Christkind (a fabulized Christ Child), and the holidays of Twelfth Night and Epiphany and their associated figures of the Three Kings (based on the gift-giving Magi of the Nativity) and Befana. Some maintain Santa Claus also absorbed elements of the Germanic god Wodan, who was associated with the pagan midwinter event of Yule and led the Wild Hunt, a ghostly procession through the sky.",
    "categories": [
      {
        "blog_id": "7",
        "category_id": "1",
        "category_name": "Business",
        "user_id": "0"
      }
    ],
    "tag_list": ""
  },
  "messages": [
    "Blog successfully added."
  ]
} 

GET /blog/:id

Get information of a specific blog

Example URI

http://example.com/restful_api/blog/7

Parameters

ParameterTypeRequire ?Description
idnumberyesBlog id

Response

 {
  "status": "success",
  "data": {
    "blog_id": "7",
    "user_id": "1",
    "title": "Santa Claus",
    "time_stamp": "1481596113",
    "time_update": "0",
    "is_approved": "1",
    "privacy": "0",
    "post_status": "1",
    "total_comment": "0",
    "total_attachment": "0",
    "total_view": "0",
    "total_like": "0",
    "module_id": "blog",
    "item_id": "0",
    "text": "Santa Claus, also known as Saint Nicholas, Saint Nick, Kris Kringle, Father Christmas, or simply Santa (Santy in Hiberno-English), is a legendary figure of Western culture who is said to bring gifts to the homes of well-behaved ("good" or "nice") children on Christmas Eve (24 December) and the early morning hours of Christmas Day (25 December). The modern Santa Claus grew out of traditions surrounding the historical Saint Nicholas, a fourth-century Greek bishop and gift-giver of Myra, the British figure of Father Christmas, the Dutch figure of Sinterklaas (himself based on Saint Nicholas), the German figure of the Christkind (a fabulized Christ Child), and the holidays of Twelfth Night and Epiphany and their associated figures of the Three Kings (based on the gift-giving Magi of the Nativity) and Befana. Some maintain Santa Claus also absorbed elements of the Germanic god Wodan, who was associated with the pagan midwinter event of Yule and led the Wild Hunt, a ghostly procession through the sky.",
    "categories": [
      {
        "blog_id": "7",
        "category_id": "1",
        "category_name": "Business",
        "user_id": "0"
      }
    ],
    "tag_list": ""
  },
  "messages": []
}

PUT /blog/:id

Update information for a specific blog

Example URI

http://example.com/restful_api/blog/7

Parameters

ParameterTypeRequire ?Description
idnumberyesBlog id
val[title]stringnoBlog title
val[text]stringnoBlog text
val[categories]arraynoBlog categories
val[privacy]numbernoLimit return results
val[tag_list]stringnoTags list for the blog
val[publish]booleannoPublish blog

Response

{
  "status": "success",
  "data": {
    "blog_id": "7",
    "user_id": "1",
    "title": "Santa Claus",
    "time_stamp": "1481596113",
    "time_update": "1481597249",
    "is_approved": "1",
    "privacy": "0",
    "post_status": "1",
    "total_comment": "0",
    "total_attachment": "0",
    "total_view": "0",
    "total_like": "0",
    "module_id": "blog",
    "item_id": "0",
    "text": "Santa Claus, also known as Saint Nicholas, Saint Nick, Kris Kringle, Father Christmas, or simply Santa (Santy in Hiberno-English), is a legendary figure of Western culture who is said to bring gifts to the homes of well-behaved ("good" or "nice") children on Christmas Eve (24 December) and the early morning hours of Christmas Day (25 December). The modern Santa Claus grew out of traditions surrounding the historical Saint Nicholas, a fourth-century Greek bishop and gift-giver of Myra, the British figure of Father Christmas, the Dutch figure of Sinterklaas (himself based on Saint Nicholas), the German figure of the Christkind (a fabulized Christ Child), and the holidays of Twelfth Night and Epiphany and their associated figures of the Three Kings (based on the gift-giving Magi of the Nativity) and Befana. Some maintain Santa Claus also absorbed elements of the Germanic god Wodan, who was associated with the pagan midwinter event of Yule and led the Wild Hunt, a ghostly procession through the sky.",
    "categories": [
      {
        "blog_id": "7",
        "category_id": "4",
        "category_name": "Family & Home",
        "user_id": "0"
      }
    ],
    "tag_list": ""
  },
  "messages": [
    "Blog successfully updated."
  ]
}

DELETE /blog/:id

Delete a specific blog

Example URI

http://example.com/restful_api/blog/7

Parameters

ParameterTypeRequire ?Description
idnumberyesBlog id

Response

 {
  "status": "success",
  "data": [],
  "messages": [
    "Blog successfully deleted."
  ]
}
  • No labels