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

GET /photo

Browse photos

Example URI

 http://example.com/restful_api/photo?user_id=10

Parameters

Parameter

Type

Require ?

Description

searchsearch

string

no

Keyword for searching

user_id

number

no

Browse by owner id

sort

string

no

Support sort return results, available values: latest, most-liked, most-talked

limit

number

no

Limit return results

page

number

no

Paging return results

item_id

number

no

Support browse photos on item (pages/groups)

module_id

string

no

Support browse photos on item (pages/groups)

category

number

no

Support search photos by category id

tag

string

no

Support search photos by tags

view

string

no

Support some view mode: pending, my, featured

Response

{
  "status": "success",
  "data": [
    {
      "is_liked": null,
      "user_id": "1",
      "photo_id": "11",
      "album_id": "0",
      "module_id": null,
      "group_id": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "title": "photo_1",
      "time_stamp": "1481515372",
      "is_featured": "0",
      "is_sponsor": "0",
      "categories": null,
      "bookmark_url": "http://example.com/photo/11/509795882_preview_maxresdefault/",
      "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/c266f348b34952c46eda13ced1daed00_1024.jpg"
    },
    {
      "is_liked": null,
      "user_id": "1",
      "photo_id": "10",
      "album_id": "0",
      "module_id": null,
      "group_id": "0",
      "privacy": "0",
      "privacy_comment": "0",
      "title": "photo_2",
      "time_stamp": "1481247906",
      "is_featured": "0",
      "is_sponsor": "0",
      "categories": null,
      "bookmark_url": "http://example.com/photo/10/509795882_preview_maxresdefault/",
      "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/0a59cf98aef18ad53619bdec43d47c97_1024.jpg"
    }
  ],
  "messages": []
}

POST /photo

Share new photos

Example URI

 http://example.com/restful_api/photo

Parameters

Parameter

Type

Require ?

Description

image[]

array

yes

Photos lists

val[description]

string

yes

Extra text to share with

val[user_id]

number

no

Support share photo on user profile

val[is_cover_photo]

boolean

no

Support upload cover photo

val[album_id]

number

no

Album id

val[privacy]

number

no

Privacy id

val[module_id]

string

no

Support share photo on item (pages/groups/event)

val[item_id]

number

no

Support share photo on item (pages/groups/event)

val[custom_pages_post_as_page]

number

no

Support share photo as page

Response

{
  "status": "success",
  "data": [
    {
      "is_liked": null,
      "user_id": "1",
      "photo_id": "14",
      "album_id": "0",
      "module_id": "event",
      "group_id": "1",
      "privacy": "0",
      "privacy_comment": "0",
      "title": "christmas-tree",
      "time_stamp": "1481888433",
      "is_featured": "0",
      "is_sponsor": "0",
      "categories": null,
      "bookmark_url": "http://example.com/photo/14/christmas-tree/",
      "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/718d0e2a99dbe3091bf5e7734ed03098_1024.png"
    },
    {
      "is_liked": null,
      "user_id": "1",
      "photo_id": "15",
      "album_id": "0",
      "module_id": "event",
      "group_id": "1",
      "privacy": "0",
      "privacy_comment": "0",
      "title": "snowman",
      "time_stamp": "1481888433",
      "is_featured": "0",
      "is_sponsor": "0",
      "categories": null,
      "bookmark_url": "http://example.com/photo/15/snowman/",
      "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/43a46fac997e887034c23c085ab0bbe8_1024.png"
    }
  ],
  "messages": [
    "Photos successfully uploaded."
  ]
}

GET /photo/:id

Get information of a specific photo

Example URI

 http://example.com/restful_api/photo/15

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Photo id

Response

{
  "status": "success",
  "data": {
    "is_liked": null,
    "user_id": "1",
    "photo_id": "15",
    "album_id": "0",
    "module_id": "event",
    "group_id": "1",
    "privacy": "0",
    "privacy_comment": "0",
    "title": "snowman",
    "time_stamp": "1481888433",
    "is_featured": "0",
    "is_sponsor": "0",
    "categories": null,
    "bookmark_url": "http://example.com/photo/15/snowman/",
    "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/43a46fac997e887034c23c085ab0bbe8_1024.png"
  },
  "messages": []
}

PUT /photo/:id

Update information for a specific photo

Example URI

 http://example.com/restful_api/photo/15

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Photo id

val[privacy]

number

no

Privacy id

val[move_to]

number

no

Album id to move

val[description]

string

no

Photo description

val[category_id][]

array

no

List of category id

val[tag_list]

string

no

List of tags

val[mature]

boolean

no

Photo is mature photo or not

val[allow_download]

boolean

no

Can download photo or not

Response

{
  "status": "success",
  "data": {
    "is_liked": null,
    "user_id": "1",
    "photo_id": "15",
    "album_id": "1",
    "module_id": null,
    "group_id": "0",
    "privacy": "0",
    "privacy_comment": "0",
    "title": "snowman",
    "time_stamp": "1481189921",
    "is_featured": "0",
    "is_sponsor": "0",
    "categories": [
      {
        "0": "Comedy",
        "1": "http://example.com/photo/category/4/comedy/",
        "category_id": "4"
      }
    ],
    "bookmark_url": "http://example.com/15/snowman/",
    "photo_url": "http://example.com/PF.Base/file/pic/photo/2016/12/43a46fac997e887034c23c085ab0bbe8_1024.png"
  },
  "messages": [
    "Photo successfully updated."
  ]
}

DELETE /photo/:id

Delete a specific photo

Example URI

 http://example.com/restful_api/photo/15

Parameters

Parameter

Type

Require ?

Description

id

number

yes

Photo id

Response

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