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

GET /blog

Browse blogs

Example URI

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

Parameters

Parameter

Type

Require ?

Description

search[search]

string

no

Keyword for searching

user_id

number

no

Browse by owner id

sort

string

no

Support sort return results

limit

number

no

Limit return results

page

number

no

Paging return results

item_id

number

no

Support search blogs on item (pages/groups)

module_id

string

no

Support search blogs on item (pages/groups)

category

number

no

Support search blogs by category id

tag

string

no

Support search blogs by tags

view

string

no

Support some view mode: spam, pending, my, draft

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": "",
      "attachments": ""
    }
  ],
  "messages": []
}

POST /blog

Post new blog

Example URI

 http://example.com/restful_api/blog

Parameters

Parameter

Type

Require ?

Description

val[title]

string

yes

Blog title

val[text]

string

yes

Blog text

val[categories]

array

no

Blog categories

val[privacy]

number

no

Limit return results

val[tag_list]

string

no

Tags list for the blog

val[publish]

boolean

no

Publish blog

val[draft]

boolean

no

Save blog as draft

val[module_id]

string

no

Support post blog on item (pages/groups...)

val[item_id]

string

no

Support post blog on item (pages/groups...)

val[attachment]

string

no

Blog's attachments

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": "",
    "attachments": ""
  },
  "messages": [
    "Blog successfully added."
  ]
}

GET /blog/:id

Get information of a specific blog

Example URI

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

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Blog 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": "",
    "attachments": ""
  },
  "messages": []
}

PUT /blog/:id

Update information for a specific blog

Example URI

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

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Blog id

val[title]

string

no

Blog title

val[text]

string

no

Blog text

val[categories]

array

no

Blog categories

val[privacy]

number

no

Limit return results

val[tag_list]

string

no

Tags list for the blog

val[publish]

boolean

no

Publish 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": "",
    "attachments": ""
  },
  "messages": [
    "Blog successfully updated."
  ]
}

DELETE /blog/:id

Delete a specific blog

Example URI

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

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Blog id

Response

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