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

« Previous Version 17 Next »

GET /feed

Browse activity feeds

Example URI

 http://example.com/restful_api/feed?page=1&limit=10

Parameters

Parameter

Type

Require ?

Description

page

number

no

Paging the result items

limit

number

no

Limit the result items

module

string

no

Support get feeds on module items

item_id

number

no

Support get feeds on module items

user_id

number

no

Support get feeds on users profile

Response

{
  "status": "success",
  "data": [
    {
      "feed_id": "53",
      "app_id": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "type_id": "custom",
      "user_id": "1",
      "parent_user_id": "0",
      "item_id": "1",
      "time_stamp": "1480906860",
      "feed_reference": "0",
      "parent_feed_id": "0",
      "parent_module_id": null,
      "time_update": "1480906860",
      "content": null,
      "total_view": "0",
      "can_post_comment": true,
      "feed_link": "http://example.com/admin/",
      "feed_title": "",
      "feed_info": "updated his/her profile information.",
      "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/misc/page_edit.png\">",
      "enable_like": false,
      "likes": [],
      "total_likes": 0,
      "feed_is_liked": false,
      "feed_like_phrase": ""
    },
    {
      "feed_id": "49",
      "app_id": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "type_id": "user_status",
      "user_id": "1",
      "parent_user_id": "0",
      "item_id": "15",
      "time_stamp": "1480678171",
      "feed_reference": "0",
      "parent_feed_id": "0",
      "parent_module_id": null,
      "time_update": "1480678171",
      "content": null,
      "total_view": "0",
      "can_post_comment": true,
      "feed_status": "Good morning everyone",
      "feed_title": "",
      "feed_link": "http://example.com/admin/?status-id=15",
      "feed_is_liked": false,
      "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/misc/application_add.png\">",
      "enable_like": true,
      "likes": [],
      "feed_like_phrase": ""
    },
  ],
  "messages": []
}

POST /feed

Create a new activity feed

Example URI

 http://example.com/restful_api/feed

Parameters

Parameter

Type

Require ?

Description

id

number

yes

User Id

val[user_status]

string

yes

Feed content

val[privacy]

number

no

Feed privacy id

val[privacy_list]

array

no

List of custom groups id

user_id

number

no

Support post feed on user profile

module

string

no

Support post feed to module item

item_id

number

no

Support post feed to module item

custom_pages_post_as_page

number

no

Support post feed as page

Response

{
   "status": "success",
   "data": {
     "feed_id": "4",
     "privacy": "1",
     "privacy_comment": "0",
     "type_id": "pages_comment",
     "user_id": "8",
     "parent_user_id": "2",
     "item_id": "2",
     "time_stamp": "1480908963",
     "parent_feed_id": "0",
     "parent_module_id": null,
     "time_update": "1480908963",
     "content": null,
     "total_view": "0",
     "can_post_comment": true,
     "feed_status": "Hi all, we will have a party tonight!!!",
     "feed_link": "http://example.com/pages/2/wall/comment-id_2/",
     "feed_is_liked": false,
     "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/misc/comment.png\">",
     "enable_like": true,
     "likes": [],
     "feed_like_phrase": ""
   },
   "messages": [
     "Feed comment successfully added."
   ]
 }

GET /feed/:id

Get information of a specific feed

Example URI

 http://example.com/restful_api/feed/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Feed id

Response

{
  "status": "success",
  "data": {
    "feed_id": "55",
    "app_id": "0",
    "privacy": "0",
    "privacy_comment": "0",
    "type_id": "blog",
    "user_id": "1",
    "parent_user_id": "0",
    "item_id": "3",
    "time_stamp": "1480909502",
    "parent_feed_id": "0",
    "parent_module_id": null,
    "time_update": "1480909502",
    "content": null,
    "total_view": "0",
    "can_post_comment": true,
    "feed_title": "Santa Claus is Coming to Town [lyrics]",
    "feed_info": "posted a blog.",
    "feed_link": "http://example.com/blog/3/santa-claus-is-coming-to-town-lyrics/",
    "feed_is_liked": false,
    "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/module/blog.png\">",
    "enable_like": true,
    "likes": [],
    "feed_like_phrase": ""
  },
  "messages": []
}

PUT /feed/:id

Update a user status feed

Example URI

 http://example.com/restful_api/feed/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Feed Id

val[user_status]

string

no

Updated status

val[privacy]

number

no

Privacy id

val[privacy_list]

array

no

List of custom groups id

Response

{
  "status": "success",
  "data": {
    "feed_id": "61",
    "app_id": "0",
    "privacy": "4",
    "privacy_comment": "0",
    "type_id": "user_status",
    "user_id": "1",
    "parent_user_id": "0",
    "item_id": "17",
    "time_stamp": "1480995719",
    "feed_reference": "0",
    "parent_feed_id": "0",
    "parent_module_id": null,
    "time_update": "1480995719",
    "content": null,
    "total_view": "0",
    "can_post_comment": true,
    "feed_status": "Hello December",
    "feed_title": "",
    "feed_link": "http://example.com/admin/?status-id=17",
    "feed_is_liked": false,
    "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/misc/application_add.png\">",
    "enable_like": true,
    "likes": [],
    "feed_like_phrase": ""
  },
  "messages": [
    "Feed successfully updated."
  ]
}

DELETE /feed/:id

Delete a specific feed

Example URI

 http://example.com/restful_api/feed/1

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Feed id

Response

{
  "status": "success",
  "data": [],
  "messages": [
    "Feed successfully deleted."
  ]
}

POST /feed/share

Share a feed item to your wall or your friends walls

Example URI

 http://example.com/restful_api/feed/share

Parameters

Parameter

Type

Require ?

Description

val[item_id]

number

yes

Item id of the feed

val[module_id]

string

yes

Module id of the feed

val[content]

string

yes

Message for sharing

val[type]

number

yes

Options: 1 - share on your wall. 2 - share on your friends walls

val[friends]

array

yes

List of friends id incase share feed on friends walls

Response

{
  "status": "success",
  "data": [
    {
      "feed_id": "65",
      "app_id": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "type_id": "feed_comment",
      "user_id": "1",
      "parent_user_id": "7",
      "item_id": "5",
      "time_stamp": "1480997941",
      "feed_reference": "0",
      "parent_feed_id": "62",
      "parent_module_id": "PHPfox_Videos",
      "time_update": "1480997941",
      "content": null,
      "total_view": "0",
      "can_post_comment": true,
      "feed_status": "great Song for Christmas",
      "feed_link": "http://example.com/profile-7/?comment-id=5",
      "feed_is_liked": false,
      "feed_icon": "<img src=\"http://example.com/PF.Base/theme/frontend/default/style/default/image/misc/comment.png\">",
      "enable_like": true,
      "likes": [],
      "feed_like_phrase": ""
    }
  ],
  "messages": [
    "Successfully shared this item on your friends wall."
  ]
}
  • No labels