Back to top

SE - YN REST API

Introduction

An easy-to-use REST API, available via HTTP/HTTPS protocols GET, POST, or DELETE. The requests can be used to grab site’s data in simple JSON format including users, photos, videos, and many more.

Authentication

This APIs uses OAuth 2.0 for authentication. Consult the official OAuth2.0 documentation for the down-and-dirty technical specifications.

All resource requests (APIs Call) are requiring oauth2 authentication.

Grant Types

Grant Types allow to expose multiple ways for a client to receive an Access Token. Currently supported grant types:

  1. Authorization Code: This grant type is used when the client wants to request access to protected resources on behalf of another user.

  2. Implicit: This grant type is similar to the Authorization Code grant type. But it is optimized for public clients, such as those implemented in javascript or on mobile devices, where client credentials cannot be stored.

  3. User Credentials: This grant type (a.k.a. Resource Owner Password Credentials) is used when the user has a trusted relationship with the client, and so can supply credentials directly.

  4. Client Credentials: This grant type is used when the client is requesting access to protected resources under its control (i.e. there is no third party).

  5. Refresh Token: This grant type is used to obtain additional access tokens in order to prolong the client’s authorization of a user’s resources.

Endpoints

Authorize Endpoint

Which requires the user to authenticate and redirects back to the client with an authorization code (Authorization Code grant type) or access token (Implicit grant type).

http://example.com/api/v1/oauth/authorize

Token Endpoint

Which uses the configured Grant Types to return an access token to the client.

http://example.com/api/v1/oauth/token

Resource Endpoint

The incomming request will be validated, and then allow the application to serve back the protected resource.

http://example.com/api/v1/:resource

Scope

Scope is used to limit the authorization granted to the client by the resource owner. Current scopes:

  • basic: Access basic resources (i.e. like, comment, link preview, search, report, member list…)

  • settings: Access user info, user settings

  • activities: Access user activities, notifications

  • albums: Access user albums

  • friends: Access user friend list, friend requests

  • messages: Access user messages

  • videos: Access user videos

  • blogs: Access user blogs

  • groups: Access user groups

  • music: Access user music

  • classifieds: Access user listings

  • events: Access user events

Tutorials

This project aims to create an easy-to-understand and well-tested framework for creating APIs. On this page, we will explain the basics of using YouNet REST APIs such as sending and receiving data, serializing data in HTTP requests, and more.

Get Authorization Code

Call the authorize endpoint to get the code.

http://example.com/api/v1/oauth/authorize?response_type=code&client_id=CLIENT_ID&scope=basic%20settings

You can request multiple scopes by supplying a space-delimited (but url-safe) list of scopes in your authorize request.

The request above will make an authorization form to user. If the user authorize this request, an authorized code will be returned to the client’s redirect URI (set in client settings).

http://app.example.com/callback?code=EXAMPLE_AUTHORIZATION_CODE

Get Access Token

Get by Authorization Code

The authorization code can be used to receive an access token from the token endpoint.

$ curl -u CLIENT_ID:CLIENT_SECRET http://example.com/api/v1/oauth/token -d 'grant_type=authorization_code&code=EXAMPLE_AUTHORIZATION_CODE'

You will receive an access token:

{"access_token":"EXAMP_LEACCESS_TOKEN","expires_in":3600,"token_type":"bearer","scope":"basic settings","refresh_token":"EXAMPLE_REFRESH_TOKEN"}

Get implicit

Setting the querystring parameter response_type=token in the authorize endpoint.

http://example.com/api/v1/oauth/authorize?response_type=token&client_id=CLIENT_ID&redirect_uri=http://app.example.com/callback

A successful token request will be returned in the fragment of the callback URI:

http://app.example.com/callback#access_token=EXAMP_LEACCESS_TOKEN&expires_in=3600&token_type=bearer

Get by User credentials

Send the user credentials directly to receive an access token

$ curl -u CLIENT_ID:CLIENT_SECRET http://example.com/api/v1/oauth/token -d 'grant_type=password&email=USER_EMAIL&password=USER_PASSWORD'

URI Parameters: email, password

This APIs also supports user Facebook credentials and user Twitter credentials

$ curl -u CLIENT_ID:CLIENT_SECRET http://example.com/api/v1/oauth/token -d 'grant_type=password&provider=facebook&uid=USER_FACEBOOK_UID'

URI Parameters: provider [facebook, twitter], uid

Get by Client credentials

Example using HTTP Basic Authentication:

$ curl -u CLIENT_ID:CLIENT_SECRET http://example.com/api/v1/oauth/token -d 'grant_type=client_credentials'

Refresh token

A refresh token must be retrieved using the Authorizaton Code or User Credentials grant types. This refresh token can then be used to generate a new access token of equal or lesser scope

$ curl -u CLIENT_ID:CLIENT_SECRET http://example.com/api/v1/oauth/token -d 'grant_type=refresh_token&refresh_token=EXAMPLE_REFRESH_TOKEN'

Access resources

To access resources, you must add access token to the URI Parameters or the header of request.

http://example.com/api/v1/activities?access_token=EXAMP_LEACCESS_TOKEN

The response data is in JSON format. Read each API for more details.

Activities

Activities

Get Activities
GET/activities{?subject_type,subject_id,limit,maxid,minid,fields}

Get activity feeds.

See Get Activity response for fields description

Scope activities

Example URI

GET http://example.com/api/v1/activities?subject_type=group&subject_id=1&limit=15&maxid=55&minid=85&fields=id
URI Parameters
HideShow
subject_type
string (optional) Example: group

Subject type

subject_id
number (optional) Example: 1

Subject identity

limit
number (optional) Example: 15

Set the number of activities in response

maxid
number (optional) Example: 55

Max indentity of more activities to get

minid
number (optional) Example: 85

Min indentity of new activities to get

fields
string (optional) Example: id

Activitiy fields can be get, separate them by comma

Choices: id owner content attachments timestamp is_liked can_like total_like user_liked can_comment total_comment comments can_delete can_share

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "count": 15,
    "next_id": 55,
    "first_id": 85,
    "end_of_feed": false,
    "items": [
      {
        "id": 1,
        "owner": {
          "id": 1,
          "type": "user",
          "title": "John Doe",
          "imgs": {
            "icon": "http://example.com/images/avatar-default-icon.png",
            "normal": "http://example.com/images/avatar-default-normal.png",
            "profile": "http://example.com/images/avatar-default-profile.png",
            "original": "http://example.com/images/avatar-default.png"
          }
        },
        "content": "<a class=\"...\" href=\"...\">John Doe</a> wrote a new blog entry:",
        "attachments": [
          {
            "id": 1,
            "type": "blog",
            "title": "Hello, world!",
            "description": "Hello, world!",
            "img": "http://example.com/images/nophoto_blog_thumb_normal.png",
            "href": "http://example.com/blogs/1"
          }
        ],
        "timestamp": 1458103508,
        "is_liked": true,
        "can_like": true,
        "total_like": 1,
        "user_liked": [
          {
            "id": 1,
            "type": "user",
            "title": "John Doe",
            "imgs": {
              "icon": "http://example.com/images/avatar-default-icon.png",
              "normal": "http://example.com/images/avatar-default-normal.png",
              "profile": "http://example.com/images/avatar-default-profile.png",
              "original": "http://example.com/images/avatar-default.png"
            }
          }
        ],
        "can_comment": true,
        "total_comment": 1,
        "comments": [
          {
            "id": 1,
            "owner": {
              "id": 1,
              "type": "user",
              "title": "John Doe",
              "imgs": {
                "icon": "http://example.com/images/avatar-default-icon.png",
                "normal": "http://example.com/images/avatar-default-normal.png",
                "profile": "http://example.com/images/avatar-default-profile.png",
                "original": "http://example.com/images/avatar-default.png"
              }
            },
            "body": "Hello, world!",
            "date": "2016-01-01 12:12:12",
            "can_delete": true,
            "is_liked": true,
            "total_like": 1
          }
        ],
        "can_delete": true,
        "can_share": true
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "count": {
          "type": "number",
          "description": "Total item on this response"
        },
        "next_id": {
          "type": "number",
          "description": "Next page max id"
        },
        "first_id": {
          "type": "number",
          "description": "First id for load new activities"
        },
        "end_of_feed": {
          "type": "boolean",
          "description": "Is the end of feeds"
        },
        "items": {
          "type": "array",
          "description": "Activity list"
        }
      },
      "description": "Result data"
    }
  }
}

Activity

Get Activity
GET/activities/{id}{?fields}

Get an activity feed.

Scope activities

Example URI

GET http://example.com/api/v1/activities/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Activity identity number

fields
string (optional) Example: id

Activitiy fields can be get, separate them by comma

Choices: id owner content attachments timestamp is_liked can_like total_like user_liked can_comment total_comment comments can_delete can_share

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "content": "<a class=\"...\" href=\"...\">John Doe</a> wrote a new blog entry:",
    "attachments": [
      {
        "id": 1,
        "type": "blog",
        "title": "Hello, world!",
        "description": "Hello, world!",
        "img": "http://example.com/images/nophoto_blog_thumb_normal.png",
        "href": "http://example.com/blogs/1"
      }
    ],
    "timestamp": 1458103508,
    "is_liked": true,
    "can_like": true,
    "total_like": 1,
    "user_liked": [
      {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      }
    ],
    "can_comment": true,
    "total_comment": 1,
    "comments": [
      {
        "id": 1,
        "owner": {
          "id": 1,
          "type": "user",
          "title": "John Doe",
          "imgs": {
            "icon": "http://example.com/images/avatar-default-icon.png",
            "normal": "http://example.com/images/avatar-default-normal.png",
            "profile": "http://example.com/images/avatar-default-profile.png",
            "original": "http://example.com/images/avatar-default.png"
          }
        },
        "body": "Hello, world!",
        "date": "2016-01-01 12:12:12",
        "can_delete": true,
        "is_liked": true,
        "total_like": 1
      }
    ],
    "can_delete": true,
    "can_share": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Activity identity number"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Activity owner"
        },
        "content": {
          "type": "string",
          "description": "Activity content"
        },
        "attachments": {
          "type": "array",
          "description": "Activity attachments"
        },
        "timestamp": {
          "type": "number",
          "description": "Activity timestamp"
        },
        "is_liked": {
          "type": "boolean",
          "description": "Is the authorized user liked this activity"
        },
        "can_like": {
          "type": "boolean",
          "description": "Is the authorized user can like this activity"
        },
        "total_like": {
          "type": "number",
          "description": "Total like"
        },
        "user_liked": {
          "type": "array",
          "description": "Users who liked this activity"
        },
        "can_comment": {
          "type": "boolean",
          "description": "Is the authorized user can comment to this activity"
        },
        "total_comment": {
          "type": "number",
          "description": "Total comment"
        },
        "comments": {
          "type": "array",
          "description": "Comment list"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Is the authorized user can delete this activity"
        },
        "can_share": {
          "type": "boolean",
          "description": "Is the authorized user can share this activity"
        }
      },
      "description": "Activity data"
    }
  }
}

Post Activity
POST/activities

Post a new activity.

Use the following APIs to add attachment

Scope activities

Example URI

POST http://example.com/api/v1/activities
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "subject_type": "group",
  "subject_id": 1,
  "body": "Hello, world!",
  "attachment[type]": "photo",
  "attachment[photo_id]": 1,
  "attachment[uri]": "http://abc.com",
  "attachment[title]": "Hello, world!",
  "attachment[description]": "Hello, world!",
  "attachment[thumb]": "http://abc.com/img/123.jpg",
  "attachment[song_id]": 1,
  "attachment[video_id]": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "subject_type": {
      "type": "string",
      "description": "Subject type"
    },
    "subject_id": {
      "type": "number",
      "description": "Subject identity"
    },
    "body": {
      "type": "string",
      "description": "Status content. Optional if have attachment"
    },
    "attachment[type]": {
      "type": "string",
      "enum": [
        "photo",
        "link",
        "music",
        "video"
      ],
      "description": "Attachment type"
    },
    "attachment[photo_id]": {
      "type": "number",
      "description": "Attachment photo identity number (if `attachment[type]` is `photo` or `video`)"
    },
    "attachment[uri]": {
      "type": "string",
      "description": "Attachment URL (if `attachment[type]` is `link`)"
    },
    "attachment[title]": {
      "type": "string",
      "description": "Attachment title (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[description]": {
      "type": "string",
      "description": "Attachment description (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[thumb]": {
      "type": "string",
      "description": "Link thumbnail (if `attachment[type]` is `link`)"
    },
    "attachment[song_id]": {
      "type": "number",
      "description": "Uploaded song identity number (if `attachment[type]` is `music`)"
    },
    "attachment[video_id]": {
      "type": "number",
      "description": "Added video identity number (if `attachment[type]` is `video`)"
    }
  },
  "required": [
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Success!",
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        },
        "id": {
          "type": "number",
          "description": "Activity identity number"
        }
      }
    }
  }
}

Delete Activity
DELETE/activities/{id}

Delete an activity feed.

Scope activities

Example URI

DELETE http://example.com/api/v1/activities/1
URI Parameters
HideShow
id
number (required) Example: 1

Activity identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "This activity item has been removed."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Share

Share
POST/activities/share

Share an item by re-posting it with a message.

Scope activities

Example URI

POST http://example.com/api/v1/activities/share
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "item_type": "blog",
  "item_id": 1,
  "body": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "item_type": {
      "type": "string",
      "description": "Type of the item that want to share"
    },
    "item_id": {
      "type": "number",
      "description": "Identity number of the item that want to share"
    },
    "body": {
      "type": "string",
      "description": "Share with a message"
    }
  },
  "required": [
    "item_type",
    "item_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Success!",
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        },
        "id": {
          "type": "number",
          "description": "Activity identity number"
        }
      }
    }
  }
}

Updates

Get Updates
GET/activities/updates

Get notification count.

Scope activities

Example URI

GET http://example.com/api/v1/activities/updates
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "notification_count": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "notification_count": {
          "type": "number",
          "description": "Total updates"
        }
      }
    }
  }
}

Albums

Album APIs

Albums

Get Albums
GET/albums{?keywords,sort,category_id,user_id,limit,page,fields}

Browse albums.

See Get Album response for fields description

Scope albums

Example URI

GET http://example.com/api/v1/albums?keywords=&sort=recent&category_id=1&user_id=1&limit=28&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search albums

sort
string (optional) Example: recent

Browse By

  • recent - Most Recent

  • popular - Most Popular

category_id
number (optional) Example: 1

Get albums in a category

user_id
number (optional) Example: 1

Get albums of an user

limit
number (optional) Example: 28

Set the number of albums in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Album fields can be get, separate them by comma

Choices: id type thumb title description owner total_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "album",
      "thumb": "http://example.com/images/nophoto_album_thumb_normal.png",
      "title": "Hello, world!",
      "description": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "total_photo": 1
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Album list"
    }
  }
}

Authorized User Albums

Get Authorized User Albums
GET/albums/my{?keywords,sort,category_id,limit,page,fields}

Get authorized user’s photo albums (My Albums).

See Get Album response for fields description

Scope albums

Example URI

GET http://example.com/api/v1/albums/my?keywords=&sort=recent&category_id=1&limit=28&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search albums

sort
string (optional) Example: recent

Browse By

  • recent - Most Recent

  • popular - Most Popular

category_id
number (optional) Example: 1

Get albums in a category

limit
number (optional) Example: 28

Set the number of albums in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Album fields can be get, separate them by comma

Choices: id type thumb title description owner total_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "album",
      "thumb": "http://example.com/images/nophoto_album_thumb_normal.png",
      "title": "Hello, world!",
      "description": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "total_photo": 1
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Album list"
    }
  }
}

Album

Get Album
GET/albums/{id}{?fields,photo_limit,photo_page,photo_fields}

Get an album detail and its photos.

Scope albums

Example URI

GET http://example.com/api/v1/albums/1?fields=id&photo_limit=25&photo_page=1&photo_fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Album identity number

fields
string (optional) Example: id

Album fields can be get, separate them by comma

Choices: id type thumb title description owner total_photo can_upload can_editphotos can_edit can_delete photos

photo_limit
number (optional) Example: 25

Set the number of photos in response

photo_page
number (optional) Example: 1

Page number of photos

photo_fields
string (optional) Example: id

Photo fields can be get, separate them by comma

Choices: id type thumb

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "type": "album",
    "thumb": "http://example.com/images/nophoto_album_thumb_normal.png",
    "title": "Hello, world!",
    "description": "Hello, world!",
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "total_photo": 1,
    "can_upload": true,
    "can_editphotos": true,
    "can_edit": true,
    "can_delete": true,
    "photos": [
      {
        "id": 1,
        "type": "album_photo",
        "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Album identity number"
        },
        "type": {
          "type": "string",
          "description": "Item type"
        },
        "thumb": {
          "type": "string",
          "description": "Album thumbnail"
        },
        "title": {
          "type": "string",
          "description": "Album title"
        },
        "description": {
          "type": "string",
          "description": "Album description"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Album owner"
        },
        "total_photo": {
          "type": "number",
          "description": "Album's photos count"
        },
        "can_upload": {
          "type": "boolean",
          "description": "Can add more photos"
        },
        "can_editphotos": {
          "type": "boolean",
          "description": "Can manage photos"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can edit settings"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can delete album"
        },
        "photos": {
          "type": "array"
        }
      },
      "description": "Album detail"
    }
  }
}

Edit Album
POST/albums/{id}

Edit an album.

Scope albums

Example URI

POST http://example.com/api/v1/albums/1
URI Parameters
HideShow
id
number (required) Example: 1

Album identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "category_id": 1,
  "description": "Hello, world!",
  "allow_search": 1,
  "auth_view": "everyone",
  "auth_comment": "everyone",
  "auth_tag": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this album."
    },
    "category_id": {
      "type": "number",
      "description": "Category indentity number of this album."
    },
    "description": {
      "type": "string",
      "description": "Description of this album."
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show this album in search results. 1 is show and 0 is not show."
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this album."
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this album."
    },
    "auth_tag": {
      "type": "string",
      "description": "Who may tag photos in this album."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Album
DELETE/albums/{id}

Delete an album.

Scope albums

Example URI

DELETE http://example.com/api/v1/albums/1
URI Parameters
HideShow
id
number (required) Example: 1

Album identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected album has been successfully deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Albums Categories

Get Categories
GET/albums/categories

Get available album categories.

Scope albums

Example URI

GET http://example.com/api/v1/albums/categories
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Arts & Culture"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Category list"
    }
  }
}

Albums View Options

Get View Options
GET/albums/view_options

Get available album view privacy options.

Scope albums

Example URI

GET http://example.com/api/v1/albums/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Albums Comment Options

Get Comment Options
GET/albums/comment_options

Get available album comment privacy options.

Scope albums

Example URI

GET http://example.com/api/v1/albums/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Albums Tag Options

Get Tag Options
GET/albums/tag_options

Get available album tag privacy options.

Scope albums

Example URI

GET http://example.com/api/v1/albums/tag_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Add New Photos

Add New Photos
POST/albums/upload

Add photos to an existed album or a new album.

Scope albums

Example URI

POST http://example.com/api/v1/albums/upload
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "photo_ids": "1,2",
  "album_id": 1,
  "album[title]": "Hello, world!",
  "album[category_id]": 1,
  "album[description]": "Hello, world!",
  "album[allow_search]": 1,
  "album[auth_view]": "everyone",
  "album[auth_comment]": "everyone",
  "album[auth_tag]": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "photo_ids": {
      "type": "string",
      "description": "Identity numbers of the uploaded photos which want to add, separate them by comma"
    },
    "album_id": {
      "type": "number",
      "description": "Identity number of the existed album which want to add new photos"
    },
    "album[title]": {
      "type": "string",
      "description": "Title of the new album."
    },
    "album[category_id]": {
      "type": "number",
      "description": "Category indentity number of the new album."
    },
    "album[description]": {
      "type": "string",
      "description": "Description of the new album."
    },
    "album[allow_search]": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show the new album in search results. 1 is show and 0 is not show."
    },
    "album[auth_view]": {
      "type": "string",
      "description": "Who may see the new album."
    },
    "album[auth_comment]": {
      "type": "string",
      "description": "Who may post comments on the new album."
    },
    "album[auth_tag]": {
      "type": "string",
      "description": "Who may tag photos in the new album."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "album_id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "album_id": {
          "type": "number",
          "description": "Album identity number"
        }
      }
    }
  }
}

Photo

Get Photo
GET/albums/photos/{id}{?conversation_id,fields}

Get details of a photo.

Scope albums

Example URI

GET http://example.com/api/v1/albums/photos/1?conversation_id=1&fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

conversation_id
number (optional) Example: 1

Conversation identity number, required if it is a message’s photo

fields
string (optional) Example: id

Album fields can be get, separate them by comma

Choices: id type thumb img title description date album photo_index next_photo previous_photo can_tag can_edit can_delete can_share can_report can_make_profile_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "type": "album_photo",
    "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png",
    "img": "http://example.com/images/123.jpg",
    "title": "Hello, world!",
    "description": "Hello, world!",
    "date": "2016-03-02 15:04:38",
    "album": {
      "id": 1,
      "type": "album",
      "title": "Hello, world!",
      "description": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "total_photo": 1
    },
    "photo_index": 0,
    "next_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "previous_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "can_tag": true,
    "can_edit": true,
    "can_delete": true,
    "can_share": true,
    "can_report": true,
    "can_make_profile_photo": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "type": {
          "type": "string",
          "description": "Item type"
        },
        "thumb": {
          "type": "string",
          "description": "Photo thumbnail"
        },
        "img": {
          "type": "string",
          "description": "Photo URL"
        },
        "title": {
          "type": "string",
          "description": "Photo title"
        },
        "description": {
          "type": "string",
          "description": "Photo caption"
        },
        "date": {
          "type": "string",
          "description": "Last modified date time"
        },
        "album": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Album identity number"
            },
            "type": {
              "type": "string",
              "description": "Item type"
            },
            "title": {
              "type": "string",
              "description": "Album title"
            },
            "description": {
              "type": "string",
              "description": "Album description"
            },
            "owner": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "Owner identity number"
                },
                "type": {
                  "type": "string",
                  "description": "Owner type"
                },
                "title": {
                  "type": "string",
                  "description": "Owner title"
                },
                "imgs": {
                  "type": "object",
                  "properties": {
                    "icon": {
                      "type": "string",
                      "description": "Photo in icon size"
                    },
                    "normal": {
                      "type": "string",
                      "description": "Photo in normal size"
                    },
                    "profile": {
                      "type": "string",
                      "description": "Photo in profile size"
                    },
                    "original": {
                      "type": "string",
                      "description": "Photo in original size"
                    }
                  },
                  "description": "Owner photos"
                }
              },
              "description": "Album owner"
            },
            "total_photo": {
              "type": "number",
              "description": "Album's photos count (available if not a message's photo)"
            }
          },
          "description": "Album of this photo"
        },
        "photo_index": {
          "type": "number",
          "description": "The index of photo in album (start with 0)"
        },
        "next_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The next photo in album"
        },
        "previous_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The previous photo in album"
        },
        "can_tag": {
          "type": "boolean",
          "description": "Can tag on this photo"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can edit this photo"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can delete this photo"
        },
        "can_share": {
          "type": "boolean",
          "description": "Can share this photo"
        },
        "can_report": {
          "type": "boolean",
          "description": "Can report this photo"
        },
        "can_make_profile_photo": {
          "type": "boolean",
          "description": "Can make this photo as the profile photo"
        }
      },
      "description": "Photo detail"
    }
  }
}

Edit Photo
POST/albums/photos/{id}

Edit a photo’s info.

Scope albums

Example URI

POST http://example.com/api/v1/albums/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "album_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this photo."
    },
    "description": {
      "type": "string",
      "description": "Description of this photo."
    },
    "album_id": {
      "type": "number",
      "description": "Move this photo to a specified album."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your changes have been saved."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Delete Photo
DELETE/albums/photos/{id}

Delete a photo.

Scope albums

Example URI

DELETE http://example.com/api/v1/albums/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Upload Photo

Upload Photo
POST/albums/photo_upload

Upload a photo to an album.

File key (required): Filedata

Scope albums

Example URI

POST http://example.com/api/v1/albums/photo_upload
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "photo_id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "photo_id": {
          "type": "number",
          "description": "Photo identity number"
        }
      }
    }
  }
}

Compose Upload

Compose Upload
POST/albums/compose_upload

Upload a photo to use as an attachment for update status, send message…

File key (required): Filedata

Scope albums

Example URI

POST http://example.com/api/v1/albums/compose_upload
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "type": "wall"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "wall",
        "profile",
        "message",
        "blog",
        "forum",
        "group",
        "event"
      ],
      "description": "Composer type"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected photo has been successfully saved.",
    "photo_id": 1,
    "album_id": 1,
    "src": "http://example.com/public/album_photo/cb/00cb_1234.jpg?c=1234"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        },
        "photo_id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "album_id": {
          "type": "number",
          "description": "Album identity number"
        },
        "src": {
          "type": "string",
          "description": "Photo source"
        }
      }
    }
  }
}

Album Cover

Set Album Cover
POST/albums/{id}/cover

Set a photo as album cover.

Scope albums

Example URI

POST http://example.com/api/v1/albums/1/cover
URI Parameters
HideShow
id
number (required) Example: 1

Album identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "photo_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "photo_id": {
      "type": "number",
      "description": "Identity number of the photo that want to set as cover"
    }
  },
  "required": [
    "photo_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Blogs

Blog APIs

Blogs

Get Blogs
GET/blogs{?keywords,sort,show,category_id,user_id,limit,page,fields}

Browse blogs.

See Get Blog response for fields description

Scope blogs

Example URI

GET http://example.com/api/v1/blogs?keywords=&sort=creation_date&show=everyone&category_id=1&user_id=1&limit=28&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search blogs

sort
string (optional) Example: creation_date

Browse By

  • creation_date - Most Recent

  • view_count - Most Viewed

show
string (optional) Example: everyone

Show

  • everyone - Everyone’s Blog

  • only_my_friend - Only My Friends’ Blogs

category_id
number (optional) Example: 1

Get blogs in a category

user_id
number (optional) Example: 1

Get blogs of an user

limit
number (optional) Example: 28

Set the number of blogs in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Blog fields can be get, separate them by comma

Choices: id type title owner date body

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "blog",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "date": "2016-03-02 15:04:38",
      "body": "Hello, world!"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Blog list"
    }
  }
}

Add Blog
POST/blogs

Write new blog entry.

Scope blogs

Example URI

POST http://example.com/api/v1/blogs
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "tags": "Hello, world!",
  "category_id": 1,
  "is_draft": 0,
  "body": "Hello, world!",
  "allow_search": 1,
  "auth_view": "everyone",
  "auth_comment": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this blog entry"
    },
    "tags": {
      "type": "string",
      "description": "Tags list of this blog entry, separate them with commas"
    },
    "category_id": {
      "type": "number",
      "description": "Identity number of the category this blog entry will belong to"
    },
    "is_draft": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Status of this blog entry. 0 - Published (default), 1 - Save As Draft"
    },
    "body": {
      "type": "string",
      "description": "Body of this blog entry"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show this blog entry in search results. 1 - Show (default), 0 - Not show"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this blog entry"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this blog entry"
    }
  },
  "required": [
    "title",
    "category_id",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Identity number of the blog entry"
        }
      }
    }
  }
}

Authorized User Blogs

Get Authorized User Blogs
GET/blogs/my{?keywords,sort,show,category_id,limit,page,fields}

Get authorized user’s blogs (My Blogs).

See Get Blog response for fields description

Scope blogs

Example URI

GET http://example.com/api/v1/blogs/my?keywords=&sort=creation_date&show=everyone&category_id=1&limit=28&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search blogs

sort
string (optional) Example: creation_date

Browse By

  • creation_date - Most Recent

  • view_count - Most Viewed

show
string (optional) Example: everyone

Show

  • everyone - Everyone’s Blog

  • only_my_friend - Only My Friends’ Blogs

category_id
number (optional) Example: 1

Get blogs in a category

limit
number (optional) Example: 28

Set the number of blogs in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Blog fields can be get, separate them by comma

Choices: id type title owner date body

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "blog",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "date": "2016-03-02 15:04:38",
      "body": "Hello, world!"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Blog list"
    }
  }
}

Blog

Get Blog
GET/blogs/{id}{?fields}

Get details of a blog.

Scope blogs

Example URI

GET http://example.com/api/v1/blogs/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Blog identity number

fields
string (optional) Example: id

Blog fields can be get, separate them by comma

Choices: id type title owner date body tags category can_edit can_delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "type": "blog",
    "title": "Hello, world!",
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "date": "2016-03-02 15:04:38",
    "body": "Hello, world!",
    "tags": [
      {
        "id": 1,
        "title": "Hello, world!"
      }
    ],
    "category": {
      "id": 1,
      "title": "Hello, world!"
    },
    "can_edit": true,
    "can_delete": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Blog identity number"
        },
        "type": {
          "type": "string",
          "description": "Item type"
        },
        "title": {
          "type": "string",
          "description": "Blog title"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Blog owner"
        },
        "date": {
          "type": "string",
          "description": "Creation date time"
        },
        "body": {
          "type": "string",
          "description": "Blog body"
        },
        "tags": {
          "type": "array",
          "description": "Tags list"
        },
        "category": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Category identity number"
            },
            "title": {
              "type": "string",
              "description": "Category name"
            }
          },
          "description": "Blog category"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can the authorized user edit this blog"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can the authorized user delete this blog"
        }
      },
      "description": "Blog detail"
    }
  }
}

Edit Blog
POST/blogs/{id}

Edit a blog entry.

Scope blogs

Example URI

POST http://example.com/api/v1/blogs/1
URI Parameters
HideShow
id
number (required) Example: 1

Blog identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "tags": "Hello, world!",
  "category_id": 1,
  "is_draft": 0,
  "body": "Hello, world!",
  "allow_search": 1,
  "auth_view": "everyone",
  "auth_comment": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this blog entry"
    },
    "tags": {
      "type": "string",
      "description": "Tags list of this blog entry, separate them with commas"
    },
    "category_id": {
      "type": "number",
      "description": "Identity number of the category this blog entry will belong to"
    },
    "is_draft": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Status of this blog entry. 0 - Published (default), 1 - Save As Draft"
    },
    "body": {
      "type": "string",
      "description": "Body of this blog entry"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show this blog entry in search results. 1 - Show (default), 0 - Not show"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this blog entry"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this blog entry"
    }
  },
  "required": [
    "title",
    "category_id",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Blog
DELETE/blogs/{id}

Delete a blog entry.

Scope blogs

Example URI

DELETE http://example.com/api/v1/blogs/1
URI Parameters
HideShow
id
number (required) Example: 1

Blog identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your blog entry has been deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Blogs Categories

Get Categories
GET/blogs/categories

Get available blog categories.

Scope blogs

Example URI

GET http://example.com/api/v1/blogs/categories
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Arts & Culture"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Category list"
    }
  }
}

Blogs View Options

Get View Options
GET/blogs/view_options

Get available blog view privacy options.

Scope blogs

Example URI

GET http://example.com/api/v1/blogs/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Blogs Comment Options

Get Comment Options
GET/blogs/comment_options

Get available blog comment privacy options.

Scope blogs

Example URI

GET http://example.com/api/v1/blogs/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Core

Core APIs

Likes

Get Likes
GET/core/likes{?item_type,item_id,page,limit}

Get user liked list.

Scope basic

Example URI

GET http://example.com/api/v1/core/likes?item_type=blog&item_id=1&page=1&limit=10
URI Parameters
HideShow
item_type
string (required) Example: blog

Type of the item to list likes

item_id
number (required) Example: 1

Identity number of the item to list likes

page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of likes in response

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Liked list"
    }
  }
}

Like
POST/core/likes

Like an item or a comment.

Scope basic

Example URI

POST http://example.com/api/v1/core/likes
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "item_type": "blog",
  "item_id": 1,
  "comment_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "item_type": {
      "type": "string",
      "description": "Type of the item to like"
    },
    "item_id": {
      "type": "number",
      "description": "Identity number of the item to like"
    },
    "comment_id": {
      "type": "number",
      "description": "Identity number of the comment to like"
    }
  },
  "required": [
    "item_type",
    "item_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Like added"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Unlike
DELETE/core/likes{?item_type,item_id,comment_id}

Unlike an item or a comment.

Scope basic

Example URI

DELETE http://example.com/api/v1/core/likes?item_type=blog&item_id=1&comment_id=
URI Parameters
HideShow
item_type
string (required) Example: blog

Type of the item to unlike

item_id
number (required) Example: 1

Identity number of the item to unlike

comment_id
number (optional) 

Identity number of the comment to unlike

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Like removed"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Comments

Get Comments
GET/core/comments{?item_type,item_id,page,limit}

Get the list of comments.

Scope basic

Example URI

GET http://example.com/api/v1/core/comments?item_type=blog&item_id=1&page=1&limit=10
URI Parameters
HideShow
item_type
string (required) Example: blog

Type of the item to get comments

item_id
number (required) Example: 1

Identity number of the item to get comments

page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of comments in response

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "body": "Hello, world!",
      "date": "2016-01-01 12:12:12",
      "can_delete": true,
      "is_liked": true,
      "total_like": 1
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Comment list"
    }
  }
}

Post Comment
POST/core/comments

Post a comment on an item.

Scope basic

Example URI

POST http://example.com/api/v1/core/comments
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "item_type": "blog",
  "item_id": 1,
  "body": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "item_type": {
      "type": "string",
      "description": "Type of the item to comment"
    },
    "item_id": {
      "type": "number",
      "description": "Identity number of the item to comment"
    },
    "body": {
      "type": "string",
      "description": "Comment body"
    }
  },
  "required": [
    "item_type",
    "item_id",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Comment added"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Delete Comment
DELETE/core/comments{?item_type,item_id,comment_id}

Delete a comment.

Scope basic

Example URI

DELETE http://example.com/api/v1/core/comments?item_type=blog&item_id=1&comment_id=1
URI Parameters
HideShow
item_type
string (required) Example: blog

Type of the item to delete comment

item_id
number (required) Example: 1

Identity number of the item to delete comment

comment_id
number (required) Example: 1

Identity number of the comment to delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Comment deleted"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Search Types

Get Search Types
GET/core/search_types

Get available item types for searching.

Scope basic

Example URI

GET http://example.com/api/v1/core/search_types
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "user",
      "title": "Members"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Type list"
    }
  }
}

Report

Report
POST/core/report

Report an item (subject).

Use Get Report Types API to get valid types

Scope basic

Example URI

POST http://example.com/api/v1/core/report
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "item_type": "blog",
  "item_id": 1,
  "type": "spam",
  "description": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "item_type": {
      "type": "string",
      "description": "Type of the subject that want to report"
    },
    "item_id": {
      "type": "number",
      "description": "Identity number of the subject that want to report"
    },
    "type": {
      "type": "string",
      "description": "Report type"
    },
    "description": {
      "type": "string",
      "description": "Report description"
    }
  },
  "required": [
    "item_type",
    "item_id",
    "type",
    "description"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your report has been submitted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Report Types

Get Report Types
GET/core/report_types

Get report types

Scope basic

Example URI

GET http://example.com/api/v1/core/report_types
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "spam",
      "title": "Spam"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Type list"
    }
  }
}

Tag

Add Tag
POST/core/tags

Tagging a resource to a subject.

Scope basic

Example URI

POST http://example.com/api/v1/core/tags
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "subject_type": "photo",
  "subject_id": 1,
  "extra[x]": 100,
  "extra[y]": 100,
  "extra[w]": 50,
  "extra[h]": 50,
  "user_id": 1,
  "label": "My Dog"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "subject_type": {
      "type": "string",
      "description": "Type of the subject that want to tag to it"
    },
    "subject_id": {
      "type": "number",
      "description": "Identity number of the subject that want to tag to it"
    },
    "extra[x]": {
      "type": "number",
      "description": "The x position of the tag area"
    },
    "extra[y]": {
      "type": "number",
      "description": "The y position of the tag area"
    },
    "extra[w]": {
      "type": "number",
      "description": "The width of the tag area"
    },
    "extra[h]": {
      "type": "number",
      "description": "The height of the tag area"
    },
    "user_id": {
      "type": "number",
      "description": "Identity number of the user that want to tag. Required if tag an user"
    },
    "label": {
      "type": "string",
      "description": "Add a tag by text instead of an user. Required if tag by text"
    }
  },
  "required": [
    "subject_type",
    "subject_id",
    "extra[x]",
    "extra[y]",
    "extra[w]",
    "extra[h]"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Identity number of the added tag"
        }
      }
    }
  }
}

Delete Tag
DELETE/core/tags/{id}{?subject_type,subject_id}

Delete a tag.

Scope basic

Example URI

DELETE http://example.com/api/v1/core/tags/1?subject_type=photo&subject_id=1
URI Parameters
HideShow
id
number (required) Example: 1

Identity number of the tag want to remove

subject_type
string (required) Example: photo

Type of the subject which have this tag

subject_id
number (required) Example: 1

Identity number of the subject which have this tag

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Classifieds

Classifieds APIs

Listings

Get Listings
GET/classifieds{?category_id,status,sort,keywords,has_photo,price_min,price_max,location,user_id,limit,page,fields}

Browse listings.

See Get Listing response for fields description

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds?category_id=1&status=all&sort=most_recent&keywords=&has_photo=0&price_min=0&price_max=0&location=&user_id=1&limit=10&page=1&fields=id
URI Parameters
HideShow
category_id
number (optional) Example: 1

Get listings in a category

status
string (optional) Example: all

Get listings by status

  • all - All Listings

  • only_open - Only Open Listings

  • only_closed - Only Closed Listings

sort
string (optional) Example: most_recent

Browse By

  • most_recent - Most Recent

  • most_viewed - Most Viewed

keywords
string (optional) 

Search listings

has_photo
number (optional) Example: 0

Only Listings With Photos

  • 0 - All Listings

  • 1 - Only Listings With Photos

price_min
number (optional) Example: 0

Search listings with min price

price_max
number (optional) Example: 0

Search listings with max price

location
string (optional) 

Seach listings by location

user_id
number (optional) Example: 1

Get listings of an user

limit
number (optional) Example: 10

Set the number of listings in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Listing fields can be get, separate them by comma

Choices: id thumb title is_closed creation_date owner price location body can_edit can_add_photos can_open can_close can_delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_classified_thumb_normal.png",
      "title": "Hello, world!",
      "is_closed": false,
      "creation_date": "2016-03-02 15:04:38",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "price": "$10.00",
      "location": "Hello, world!",
      "body": "Hello, world!",
      "can_edit": true,
      "can_add_photos": true,
      "can_open": false,
      "can_close": true,
      "can_delete": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Listing list"
    }
  }
}

Add Listing
POST/classifieds

Create new listing.

File key (optional): photo - Upload a main photo for listing

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "tags": "Hello, world!",
  "category_id": 1,
  "body": "Hello, world!",
  "fields[price]": 1,
  "fields[location]": "Hello, world!",
  "auth_view": "everyone",
  "auth_comment": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Listing title"
    },
    "tags": {
      "type": "string",
      "description": "Listing tag list, separate them by comma"
    },
    "category_id": {
      "type": "number",
      "description": "Listing Category identity number"
    },
    "body": {
      "type": "string",
      "description": "Listing body"
    },
    "fields[price]": {
      "type": "number",
      "description": "Listing price"
    },
    "fields[location]": {
      "type": "string",
      "description": "Listing location"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this classified listing"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this classified listing"
    }
  },
  "required": [
    "title",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Identity number of the listing"
        }
      }
    }
  }
}

Authorized User's Listings

Get Authorized User's Listings
GET/classifieds/my{?category_id,status,sort,keywords,has_photo,price_min,price_max,location,limit,page,fields}

Browse authorized user’s listings (My Listings).

See Get Listing response for fields description

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds/my?category_id=1&status=all&sort=most_recent&keywords=&has_photo=0&price_min=0&price_max=0&location=&limit=10&page=1&fields=id
URI Parameters
HideShow
category_id
number (optional) Example: 1

Get listings in a category

status
string (optional) Example: all

Get listings by status

  • all - All Listings

  • only_open - Only Open Listings

  • only_closed - Only Closed Listings

sort
string (optional) Example: most_recent

Browse By

  • most_recent - Most Recent

  • most_viewed - Most Viewed

keywords
string (optional) 

Search listings

has_photo
number (optional) Example: 0

Only Listings With Photos

  • 0 - All Listings

  • 1 - Only Listings With Photos

price_min
number (optional) Example: 0

Search listings with min price

price_max
number (optional) Example: 0

Search listings with max price

location
string (optional) 

Seach listings by location

limit
number (optional) Example: 10

Set the number of listings in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Listing fields can be get, separate them by comma

Choices: id thumb title is_closed creation_date owner price location body can_edit can_add_photos can_open can_close can_delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_classified_thumb_normal.png",
      "title": "Hello, world!",
      "is_closed": false,
      "creation_date": "2016-03-02 15:04:38",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "price": "$10.00",
      "location": "Hello, world!",
      "body": "Hello, world!",
      "can_edit": true,
      "can_add_photos": true,
      "can_open": false,
      "can_close": true,
      "can_delete": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Listing list"
    }
  }
}

Listing

Get Listing
GET/classifieds/{id}{?fields}

Get listing details.

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Listing identity number

fields
string (optional) Example: id

Listing fields can be get, separate them by comma

Choices: id thumb title is_closed creation_date owner price location body category tags photos can_edit can_add_photos can_open can_close can_delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "thumb": "http://example.com/images/nophoto_classified_thumb_normal.png",
    "title": "Hello, world!",
    "is_closed": false,
    "creation_date": "2016-03-02 15:04:38",
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "price": "$10.00",
    "location": "Hello, world!",
    "body": "Hello, world!",
    "category": {
      "id": 1,
      "title": "Hello, world!"
    },
    "tags": [
      {
        "id": 1,
        "title": "Hello, world!"
      }
    ],
    "photos": [
      {
        "id": 1,
        "description": "Hello, world!",
        "img": "http://example.com/images/abc123.jpg",
        "is_main": true
      }
    ],
    "can_edit": true,
    "can_add_photos": true,
    "can_open": false,
    "can_close": true,
    "can_delete": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Listing identity number"
        },
        "thumb": {
          "type": "string",
          "description": "Listing thumbnail"
        },
        "title": {
          "type": "string",
          "description": "Listing title"
        },
        "is_closed": {
          "type": "boolean",
          "description": "Is this listing closed"
        },
        "creation_date": {
          "type": "string",
          "description": "Creation date time"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Listing owner"
        },
        "price": {
          "type": "string",
          "description": "Listing price"
        },
        "location": {
          "type": "string",
          "description": "Listing location"
        },
        "body": {
          "type": "string",
          "description": "Listing body"
        },
        "category": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Category identity number"
            },
            "title": {
              "type": "string",
              "description": "Category name"
            }
          },
          "description": "Listing category"
        },
        "tags": {
          "type": "array",
          "description": "Listing tags"
        },
        "photos": {
          "type": "array",
          "description": "Listing photos"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can the authorized user edit this listing"
        },
        "can_add_photos": {
          "type": "boolean",
          "description": "Can the authorized user add photos to this listing"
        },
        "can_open": {
          "type": "boolean",
          "description": "Can the authorized user open this listing"
        },
        "can_close": {
          "type": "boolean",
          "description": "Can the authorized user close this listing"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can the authorized user delete this listing"
        }
      },
      "description": "Listing details"
    }
  }
}

Edit Listing
POST/classifieds/{id}

Edit listing details.

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds/1
URI Parameters
HideShow
id
number (required) Example: 1

Listing identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "tags": "Hello, world!",
  "category_id": 1,
  "body": "Hello, world!",
  "fields[price]": 1,
  "fields[location]": "Hello, world!",
  "auth_view": "everyone",
  "auth_comment": "everyone",
  "main_photo_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Listing title"
    },
    "tags": {
      "type": "string",
      "description": "Listing tag list, separate them by comma"
    },
    "category_id": {
      "type": "number",
      "description": "Listing Category identity number"
    },
    "body": {
      "type": "string",
      "description": "Listing body"
    },
    "fields[price]": {
      "type": "number",
      "description": "Listing price"
    },
    "fields[location]": {
      "type": "string",
      "description": "Listing location"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this classified listing"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this classified listing"
    },
    "main_photo_id": {
      "type": "number",
      "description": "Set a main photo for this classified listing"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Listing
DELETE/classifieds/{id}

Delete a listing.

Scope classifieds

Example URI

DELETE http://example.com/api/v1/classifieds/1
URI Parameters
HideShow
id
number (required) Example: 1

Listing identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your classified listing has been deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Close Listing

Close Listing
POST/classifieds/close

Close a listing.

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds/close
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Listing identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Open Listing

Open Listing
POST/classifieds/open

Open a listing.

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds/open
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Listing identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Listing Categories

Get Categories
GET/classifieds/categories

Get available listing categories.

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds/categories
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Arts & Culture"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Category list"
    }
  }
}

Listing View Options

Get View Options
GET/classifieds/view_options

Get available listing view privacy options.

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Listing Comment Options

Get Comment Options
GET/classifieds/comment_options

Get available listing comment privacy options.

Scope classifieds

Example URI

GET http://example.com/api/v1/classifieds/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Classified Photos

Upload Photo
POST/classifieds/photos

Upload a photo to a listing.

File key (required): Filedata

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds/photos
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "classified_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "classified_id": {
      "type": "number",
      "description": "Listing identity number"
    }
  },
  "required": [
    "classified_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        }
      }
    }
  }
}

Classified Photo

Edit Photo
POST/classifieds/photos/{id}

Edit a photo’s info.

Scope classifieds

Example URI

POST http://example.com/api/v1/classifieds/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "description": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "description": {
      "type": "string",
      "description": "Description of this photo."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your changes have been saved."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Delete Photo
DELETE/classifieds/photos/{id}

Delete a photo.

Scope classifieds

Example URI

DELETE http://example.com/api/v1/classifieds/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Events

Event APIs

Events

Get Events
GET/events{?keywords,category_id,view,sort,user_id,limit,page,fields}

Browse events.

See Get Event response for fields description

Scope events

Example URI

GET http://example.com/api/v1/events?keywords=&category_id=1&view=everyone&sort=``&user_id=1&limit=10&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search events

category_id
number (optional) Example: 1

Get events in a category

view
string (optional) Example: everyone

View

  • everyone - Everyone’s Events

  • only_my_friend - Only My Friends’ Events

sort
string (optional) Example: ``

List By

  • starttime - Start Time

  • creation_date - Recently Created

  • member_count - Most Popular

user_id
number (optional) Example: 1

Get events of an user

limit
number (optional) Example: 10

Set the number of events in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Event fields can be get, separate them by comma

Choices: id thumb title owner description total_member can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_compose

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_event_thumb_normal.png",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "description": "Hello, world!",
      "total_member": 1,
      "start_datetime": "May 26, 2016 2:00 PM BST"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Event list"
    }
  }
}

Add Event
POST/events

Create new event.

File key (optional): photo - Upload an event profile photo

Scope events

Example URI

POST http://example.com/api/v1/events
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "category_id": 1,
  "start_time": "2016-01-01 01:10:00",
  "end_time": "2016-01-01 01:10:00",
  "allow_search": 1,
  "auth_invite": 1,
  "approval": 0,
  "auth_view": "everyone",
  "auth_comment": "everyone",
  "auth_photo": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Event Name"
    },
    "description": {
      "type": "string",
      "description": "Event Description"
    },
    "category_id": {
      "type": "number",
      "description": "Event Category identity number"
    },
    "start_time": {
      "type": "string",
      "description": "Event start date and time (YYYY-MM-DD HH-mm-ss)"
    },
    "end_time": {
      "type": "string",
      "description": "Event end date and time (YYYY-MM-DD HH-mm-ss)"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Include this event in search results. 1 - Include (default), 0 - Hide"
    },
    "auth_invite": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Invited guests can invite other people as well. 1 - Yes (default), 0 - No"
    },
    "approval": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Should people try to join this event must be approved. 0 - Can join immediately (default), 1 - Must be approved"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this event"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post on this event's wall"
    },
    "auth_photo": {
      "type": "string",
      "description": "Who may upload photos to this event"
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Identity number of the event"
        }
      }
    }
  }
}

Authorized User Events

Get Authorized User Events
GET/events/my{?keywords,view,limit,page,fields}

Get authorized user’s events (My Events).

See Get Event response for fields description

Scope events

Example URI

GET http://example.com/api/v1/events/my?keywords=&view=all_my_events&limit=10&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search events

view
string (optional) Example: all_my_events

View

  • all_my_events - All My Events

  • only_events_i_lead - Only Events I Lead

limit
number (optional) Example: 10

Set the number of events in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Event fields can be get, separate them by comma

Choices: id thumb title category owner description total_member can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_compose

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_event_thumb_normal.png",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "description": "Hello, world!",
      "total_member": 1,
      "start_datetime": "May 26, 2016 2:00 PM BST"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Event list"
    }
  }
}

Event

Get Event
GET/events/{id}{?fields}

Get information of an event.

Scope events

Example URI

GET http://example.com/api/v1/events/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Event identity number

fields
string (optional) Example: id

Event fields can be get, separate them by comma

Choices: id thumb title category owner description total_member can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_compose

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Hello, world!",
    "description": "Hello, world!",
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "category": {
      "id": 1,
      "title": "Hello, world!"
    },
    "thumb": "http://example.com/images/nophoto_event_thumb_normal.png",
    "total_member": 1,
    "start_date": "1/1/16",
    "start_time": "11:00 AM",
    "end_date": "1/1/16",
    "end_time": "11:00 AM",
    "host": "Hello, world!",
    "location": "Hello, world!",
    "attending_count": 1,
    "maybe_count": 1,
    "not_attending_count": 1,
    "awaiting_reply_count": 1,
    "can_edit": true,
    "can_delete": true,
    "can_request": false,
    "can_join": false,
    "can_leave": false,
    "can_cancel": false,
    "can_accept": false,
    "can_reject": false,
    "can_invite": true,
    "can_compose": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Event identity number"
        },
        "title": {
          "type": "string",
          "description": "Event title"
        },
        "description": {
          "type": "string",
          "description": "Event description"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Event owner"
        },
        "category": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Category identity number"
            },
            "title": {
              "type": "string",
              "description": "Category name"
            }
          },
          "description": "Event category"
        },
        "thumb": {
          "type": "string",
          "description": "Event thumbnail"
        },
        "total_member": {
          "type": "number",
          "description": "Total members"
        },
        "start_date": {
          "type": "string"
        },
        "start_time": {
          "type": "string"
        },
        "end_date": {
          "type": "string"
        },
        "end_time": {
          "type": "string"
        },
        "host": {
          "type": "string",
          "description": "Event host"
        },
        "location": {
          "type": "string",
          "description": "Event location"
        },
        "attending_count": {
          "type": "number",
          "description": "Total attending members"
        },
        "maybe_count": {
          "type": "number",
          "description": "Total maybe attending members"
        },
        "not_attending_count": {
          "type": "number",
          "description": "Total not attending members"
        },
        "awaiting_reply_count": {
          "type": "number",
          "description": "Total awaiting reply members"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can the authorized user edit this event"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can the authorized user delete this event"
        },
        "can_request": {
          "type": "boolean",
          "description": "Can the authorized user request membership"
        },
        "can_join": {
          "type": "boolean",
          "description": "Can the authorized user join this event"
        },
        "can_leave": {
          "type": "boolean",
          "description": "Can the authorized user leave this event"
        },
        "can_cancel": {
          "type": "boolean",
          "description": "Can the authorized user cancel membership request"
        },
        "can_accept": {
          "type": "boolean",
          "description": "Can the authorized user accept membership request"
        },
        "can_reject": {
          "type": "boolean",
          "description": "Can the authorized user ignore membership request"
        },
        "can_invite": {
          "type": "boolean",
          "description": "Can the authorized user invite people to this event"
        },
        "can_compose": {
          "type": "boolean",
          "description": "Can the authorized user compose message to members"
        }
      },
      "description": "Event info"
    }
  }
}

Edit Event
POST/events/{id}

Edit event details.

File key (optional): photo - Upload an event profile photo

Scope events

Example URI

POST http://example.com/api/v1/events/1
URI Parameters
HideShow
id
number (required) Example: 1

Event identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "category_id": 1,
  "allow_search": 1,
  "auth_invite": 1,
  "approval": 0,
  "auth_view": "everyone",
  "auth_comment": "registered",
  "auth_photo": "registered"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Event Name"
    },
    "description": {
      "type": "string",
      "description": "Event Description"
    },
    "category_id": {
      "type": "number",
      "description": "Event Category identity number"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Include this event in search results. 1 - Include (default), 0 - Hide"
    },
    "auth_invite": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Invited guests can invite other people as well. 1 - Yes (default), 0 - No"
    },
    "approval": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Should people try to join this event must be approved. 0 - Can join immediately (default), 1 - Must be approved"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this event"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post on this event's wall"
    },
    "auth_photo": {
      "type": "string",
      "description": "Who may upload photos to this event"
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Event
DELETE/events/{id}

Delete an event.

Scope events

Example URI

DELETE http://example.com/api/v1/events/1
URI Parameters
HideShow
id
number (required) Example: 1

Event identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected event has been deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Categories

Get Categories
GET/events/categories

Get available event categories.

Scope events

Example URI

GET http://example.com/api/v1/events/categories
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Arts & Culture"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Category list"
    }
  }
}

Events View Options

Get View Options
GET/events/view_options

Get available event view privacy options.

Scope events

Example URI

GET http://example.com/api/v1/events/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Events Comment Options

Get Comment Options
GET/events/comment_options

Get available event comment privacy options.

Scope events

Example URI

GET http://example.com/api/v1/events/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Events Photo Options

Get Photo Options
GET/events/photo_options

Get available privacy options of uploading photos to an event.

Scope events

Example URI

GET http://example.com/api/v1/events/photo_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Events Members

Get Members
GET/events/members{?event_id,limit,page}

Get members of an event.

Scope events

Example URI

GET http://example.com/api/v1/events/members?event_id=&limit=10&page=
URI Parameters
HideShow
event_id
number (required) 

Event identity number

limit
number (optional) Example: 10

Set the number of members in response

page
number (optional) 

Page number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      },
      "status": "Hello, world!",
      "is_owner": true,
      "can_delete": true,
      "can_approve": true,
      "can_reject": true,
      "can_cancel": true,
      "rsvp": "Attending"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Events Member

Remove Member
DELETE/events/member{?event_id,user_id}

Remove an event member or Cancel an invitation to a user.

Scope events

Example URI

DELETE http://example.com/api/v1/events/member?event_id=1&user_id=1
URI Parameters
HideShow
event_id
number (required) Example: 1

Event identity number

user_id
number (required) Example: 1

Member or invited user identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "This member has been successfully removed from the event."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Waiting Members

Get Waiting Members
GET/events/waiting_members{?event_id,limit,page}

Get waiting members of an event.

Scope events

Example URI

GET http://example.com/api/v1/events/waiting_members?event_id=1&limit=10&page=1
URI Parameters
HideShow
event_id
number (required) Example: 1

Event identity number

limit
number (optional) Example: 10

Set the number of members in response

page
number (optional) Example: 1

Page number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      },
      "status": "Hello, world!",
      "is_owner": false,
      "can_delete": true,
      "can_approve": true,
      "can_reject": true,
      "can_cancel": true,
      "rsvp": "Attending"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Approve Member

Approve Member
POST/events/approve_member

Approve a membership request.

Scope events

Example URI

POST http://example.com/api/v1/events/approve_member
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "event_id": 1,
  "user_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "event_id": {
      "type": "number",
      "description": "Event identity number"
    },
    "user_id": {
      "type": "number",
      "description": "Requested user identity number"
    }
  },
  "required": [
    "event_id",
    "user_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Event request approved"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Reject Member

Reject Member
POST/events/reject_member

Reject a membership request.

Scope events

Example URI

POST http://example.com/api/v1/events/reject_member
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "event_id": 1,
  "user_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "event_id": {
      "type": "number",
      "description": "Event identity number"
    },
    "user_id": {
      "type": "number",
      "description": "Requested user identity number"
    }
  },
  "required": [
    "event_id",
    "user_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Event member removed."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Join

Join Event
POST/events/join

Join an event.

Scope events

Example URI

POST http://example.com/api/v1/events/join
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "rsvp": "attending"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    },
    "rsvp": {
      "type": "string",
      "enum": [
        "attending",
        "maybe_attending",
        "not_attending"
      ],
      "description": "RSVP"
    }
  },
  "required": [
    "id",
    "rsvp"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have successfully RSVPed to this event."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Request

Request Membership
POST/events/request

Request membership of an event.

Scope events

Example URI

POST http://example.com/api/v1/events/request
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your invite request has been sent."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Cancel

Cancel Membership Request
POST/events/cancel

Cancel request membership of an event.

Scope events

Example URI

POST http://example.com/api/v1/events/cancel
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your invite request has been cancelled."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Leave

Leave Event
POST/events/leave

Leave an event.

Scope events

Example URI

POST http://example.com/api/v1/events/leave
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You are no longer a member of this event."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Rsvp

Update rsvp
POST/events/rsvp

Update RSVP.

Scope events

Example URI

POST http://example.com/api/v1/events/rsvp
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "rsvp": "attending"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    },
    "rsvp": {
      "type": "string",
      "enum": [
        "attending",
        "maybe_attending",
        "not_attending"
      ],
      "description": "RSVP"
    }
  },
  "required": [
    "id",
    "rsvp"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "RSVP Updated."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Accept

Accept Membership Request
POST/events/accept

Accept a membership invitation.

Scope events

Example URI

POST http://example.com/api/v1/events/accept
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "rsvp": "attending"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    },
    "rsvp": {
      "type": "string",
      "enum": [
        "attending",
        "maybe_attending",
        "not_attending"
      ],
      "description": "RSVP"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have accepted the invite to the event Example Event"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Reject

Ignore Membership Request
POST/events/reject

Reject a membership invitation.

Scope events

Example URI

POST http://example.com/api/v1/events/reject
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have ignored the invite to the event Example Event"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Invite

Get Can Invite Friends
GET/events/invite{?id}

Get a list of friends who user can invite.

Scope events

Example URI

GET http://example.com/api/v1/events/invite?id=1
URI Parameters
HideShow
id
number (required) Example: 1

Event identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Invite Friends
POST/events/invite

Invite friends to an event.

Scope events

Example URI

POST http://example.com/api/v1/events/invite
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "user_ids": "1,2"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Event identity number"
    },
    "user_ids": {
      "type": "string",
      "description": "Identity numbers of friends, separated by commas"
    }
  },
  "required": [
    "id",
    "user_ids"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected members have been successfully invited."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Events Photos

Get Photos
GET/events/photos{?event_id,limit,page,fields}

Get photos of an event.

Scope events

Example URI

GET http://example.com/api/v1/events/photos?event_id=1&limit=8&page=1&fields=id
URI Parameters
HideShow
event_id
number (required) Example: 1

Event identity number

limit
number (optional) Example: 8

Set the number of photos in response

page
number (optional) Example: 1

Page number of photos

fields
string (optional) Example: id

Photo fields can be get, separate them by comma

Choices: id type thumb img title description date event photo_index next_photo previous_photo can_tag can_edit can_delete can_share can_report can_make_profile_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array"
    }
  }
}

Add Photos
POST/events/photos

Add uploaded photos to event.

  • Use Upload Photo to upload photo and get it’s identity number.

Scope events

Example URI

POST http://example.com/api/v1/events/photos
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "event_id": 1,
  "ids": "1,2"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "event_id": {
      "type": "number",
      "description": "Event identity number"
    },
    "ids": {
      "type": "string",
      "description": "Uploaded photo's identity numbers, separate them by comma"
    }
  },
  "required": [
    "event_id",
    "ids"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Events Photo

Get Photo
GET/events/photos/{id}{?fields}

Get photo details.

Scope events

Example URI

GET http://example.com/api/v1/events/photos/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

fields
string (optional) Example: id

Photo fields can be get, separate them by comma

Choices: id type thumb img title description date event photo_index next_photo previous_photo can_tag can_edit can_delete can_share can_report can_make_profile_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png",
    "img": "http://example.com/images/123.jpg",
    "title": "Hello, world!",
    "description": "Hello, world!",
    "date": "2016-03-02 15:04:38",
    "event": {
      "id": 1,
      "type": "event",
      "title": "Hello, world!",
      "description": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "total_photo": 1
    },
    "photo_index": 0,
    "next_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "previous_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "can_tag": true,
    "can_edit": true,
    "can_delete": true,
    "can_share": true,
    "can_report": true,
    "can_make_profile_photo": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "thumb": {
          "type": "string",
          "description": "Photo thumbnail"
        },
        "img": {
          "type": "string",
          "description": "Photo URL"
        },
        "title": {
          "type": "string",
          "description": "Photo title"
        },
        "description": {
          "type": "string",
          "description": "Photo caption"
        },
        "date": {
          "type": "string",
          "description": "Last modified date time"
        },
        "event": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Event identity number"
            },
            "type": {
              "type": "string",
              "description": "Item type"
            },
            "title": {
              "type": "string",
              "description": "Event title"
            },
            "description": {
              "type": "string",
              "description": "Event description"
            },
            "owner": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "Owner identity number"
                },
                "type": {
                  "type": "string",
                  "description": "Owner type"
                },
                "title": {
                  "type": "string",
                  "description": "Owner title"
                },
                "imgs": {
                  "type": "object",
                  "properties": {
                    "icon": {
                      "type": "string",
                      "description": "Photo in icon size"
                    },
                    "normal": {
                      "type": "string",
                      "description": "Photo in normal size"
                    },
                    "profile": {
                      "type": "string",
                      "description": "Photo in profile size"
                    },
                    "original": {
                      "type": "string",
                      "description": "Photo in original size"
                    }
                  },
                  "description": "Owner photos"
                }
              },
              "description": "Event owner"
            },
            "total_photo": {
              "type": "number",
              "description": "Event's photos count (available if not a message's photo)"
            }
          },
          "description": "Event of this photo"
        },
        "photo_index": {
          "type": "number",
          "description": "The index of photo in event (start with 0)"
        },
        "next_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The next photo in event"
        },
        "previous_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The previous photo in event"
        },
        "can_tag": {
          "type": "boolean",
          "description": "Can tag on this photo"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can edit this photo"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can delete this photo"
        },
        "can_share": {
          "type": "boolean",
          "description": "Can share this photo"
        },
        "can_report": {
          "type": "boolean",
          "description": "Can report this photo"
        },
        "can_make_profile_photo": {
          "type": "boolean",
          "description": "Can make this photo as the profile photo"
        }
      }
    }
  }
}

Edit Photo
POST/events/photos/{id}

Edit a photo’s info.

Scope events

Example URI

POST http://example.com/api/v1/events/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this photo."
    },
    "description": {
      "type": "string",
      "description": "Description of this photo."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your changes have been saved."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Delete Photo
DELETE/events/photos/{id}

Delete a photo.

Scope events

Example URI

DELETE http://example.com/api/v1/events/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The photo has been successfully deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Upload Photo

Upload Photo
POST/events/photos_upload

Upload a photo to an event.

File key (required): Filedata

Scope events

Example URI

POST http://example.com/api/v1/events/photos_upload
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "event_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "event_id": {
      "type": "number",
      "description": "Event identity number"
    }
  },
  "required": [
    "event_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "name": "abc123.jpg"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "name": {
          "type": "string",
          "description": "Photo name"
        }
      }
    }
  }
}

Groups

Group APIs

Groups

Get Groups
GET/groups{?keywords,category_id,show,sort,user_id,limit,page,fields}

Browse groups.

See Get Group response for fields description

Scope groups

Example URI

GET http://example.com/api/v1/groups?keywords=&category_id=1&show=everyone&sort=creation_date&user_id=1&limit=10&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search groups

category_id
number (optional) Example: 1

Get groups in a category

show
string (optional) Example: everyone

View

  • everyone - Everyone’s Group

  • only_my_friend - Only My Friends’ Groups

sort
string (optional) Example: creation_date

List By

  • recently_created - Recently Created

  • most_popular - Most Popular

user_id
number (optional) Example: 1

Get groups of an user

limit
number (optional) Example: 10

Set the number of groups in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Group fields can be get, separate them by comma

Choices: id thumb title category owner description staff total_view total_member updated_date can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_message_members

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_group_thumb_normal.png",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "description": "Hello, world!",
      "total_member": 1,
      "can_edit": true,
      "can_delete": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Group list"
    }
  }
}

Add Group
POST/groups

Create new group.

File key (optional): photo - Upload a group profile photo

Scope groups

Example URI

POST http://example.com/api/v1/groups
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "category_id": 1,
  "allow_search": 1,
  "auth_invite": "member",
  "approval": 0,
  "auth_view": "everyone",
  "auth_comment": "registered",
  "auth_photo": "registered",
  "auth_event": "registered"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Group Name"
    },
    "description": {
      "type": "string",
      "description": "Group Description"
    },
    "category_id": {
      "type": "number",
      "description": "Group Category identity number"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Include this group in search results. 1 - Include (default), 0 - Hide"
    },
    "auth_invite": {
      "type": "string",
      "enum": [
        "member",
        "officer"
      ],
      "description": "Who can invite other people. `member` - Members (default), `officer` - Only officers"
    },
    "approval": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Should people try to join this group must be approved. 0 - Can join immediately (default), 1 - Must be approved"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this group"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post on this group's wall"
    },
    "auth_photo": {
      "type": "string",
      "description": "Who may upload photos to this group"
    },
    "auth_event": {
      "type": "string",
      "description": "Who may create events for this group"
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Identity number of the group"
        }
      }
    }
  }
}

Authorized User Groups

Get Authorized User Groups
GET/groups/my{?keywords,show,limit,page,fields}

Get authorized user’s groups (My Groups).

See Get Group response for fields description

Scope groups

Example URI

GET http://example.com/api/v1/groups/my?keywords=&show=all_my_groups&limit=10&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) 

Search groups

show
string (optional) Example: all_my_groups

View

  • all_my_groups - All My Groups

  • only_groups_i_lead - Only Groups I Lead

limit
number (optional) Example: 10

Set the number of groups in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Group fields can be get, separate them by comma

Choices: id thumb title category owner description staff total_view total_member updated_date can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_message_members

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_group_thumb_normal.png",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "description": "Hello, world!",
      "total_member": 1,
      "can_edit": true,
      "can_delete": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Group list"
    }
  }
}

Group

Get Group
GET/groups/{id}{?fields}

Get information of a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Group identity number

fields
string (optional) Example: id

Group fields can be get, separate them by comma

Choices: id thumb title category owner description staff total_view total_member updated_date can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_message_members

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "thumb": "http://example.com/images/nophoto_group_thumb_normal.png",
    "title": "Hello, world!",
    "category": {
      "id": 1,
      "title": "Hello, world!"
    },
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "description": "Hello, world!",
    "staff": [
      {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        },
        "membership": "owner"
      }
    ],
    "total_view": 1,
    "total_member": 1,
    "updated_date": "2016-03-02 15:04:38",
    "can_edit": true,
    "can_delete": true,
    "can_request": false,
    "can_join": false,
    "can_leave": false,
    "can_cancel": false,
    "can_accept": false,
    "can_reject": false,
    "can_invite": true,
    "can_message_members": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Group identity number"
        },
        "thumb": {
          "type": "string",
          "description": "Group thumbnail"
        },
        "title": {
          "type": "string",
          "description": "Group title"
        },
        "category": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Category identity number"
            },
            "title": {
              "type": "string",
              "description": "Category name"
            }
          },
          "description": "Group category"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Group owner"
        },
        "description": {
          "type": "string",
          "description": "Group description"
        },
        "staff": {
          "type": "array",
          "description": "Group staff list"
        },
        "total_view": {
          "type": "number",
          "description": "Total views"
        },
        "total_member": {
          "type": "number",
          "description": "Total members"
        },
        "updated_date": {
          "type": "string",
          "description": "Modified date time"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can the authorized user edit this group"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can the authorized user delete this group"
        },
        "can_request": {
          "type": "boolean",
          "description": "Can the authorized user request membership"
        },
        "can_join": {
          "type": "boolean",
          "description": "Can the authorized user join this group"
        },
        "can_leave": {
          "type": "boolean",
          "description": "Can the authorized user leave this group"
        },
        "can_cancel": {
          "type": "boolean",
          "description": "Can the authorized user cancel membership request"
        },
        "can_accept": {
          "type": "boolean",
          "description": "Can the authorized user accept membership request"
        },
        "can_reject": {
          "type": "boolean",
          "description": "Can the authorized user ignore membership request"
        },
        "can_invite": {
          "type": "boolean",
          "description": "Can the authorized user invite people to this group"
        },
        "can_message_members": {
          "type": "boolean",
          "description": "Can the authorized user compose message to members"
        }
      },
      "description": "Group info"
    }
  }
}

Edit Group
POST/groups/{id}

Edit group details.

File key (optional): photo - Upload a group profile photo

Scope groups

Example URI

POST http://example.com/api/v1/groups/1
URI Parameters
HideShow
id
number (required) Example: 1

Group identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "category_id": 1,
  "allow_search": 1,
  "auth_invite": "member",
  "approval": 0,
  "auth_view": "everyone",
  "auth_comment": "registered",
  "auth_photo": "registered",
  "auth_event": "registered"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Group Name"
    },
    "description": {
      "type": "string",
      "description": "Group Description"
    },
    "category_id": {
      "type": "number",
      "description": "Group Category identity number"
    },
    "allow_search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Include this group in search results. 1 - Include (default), 0 - Hide"
    },
    "auth_invite": {
      "type": "string",
      "enum": [
        "member",
        "officer"
      ],
      "description": "Who can invite other people. `member` - Members (default), `officer` - Only officers"
    },
    "approval": {
      "type": "number",
      "enum": [
        0,
        1
      ],
      "description": "Should people try to join this group must be approved. 0 - Can join immediately (default), 1 - Must be approved"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this group"
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post on this group's wall"
    },
    "auth_photo": {
      "type": "string",
      "description": "Who may upload photos to this group"
    },
    "auth_event": {
      "type": "string",
      "description": "Who may create events for this group"
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Group
DELETE/groups/{id}

Delete a group.

Scope groups

Example URI

DELETE http://example.com/api/v1/groups/1
URI Parameters
HideShow
id
number (required) Example: 1

Group identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected group has been deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Members

Get Members
GET/groups/members{?group_id,limit,page}

Get members of a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/members?group_id=1&limit=10&page=1
URI Parameters
HideShow
group_id
number (required) Example: 1

Group identity number

limit
number (optional) Example: 10

Set the number of members in response

page
number (optional) Example: 1

Page number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      },
      "status": "Hello, world!",
      "membership": "owner"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Group Member

Remove Member
DELETE/groups/member{?group_id,user_id}

Remove a group member or Cancel an invitation to a user.

Scope groups

Example URI

DELETE http://example.com/api/v1/groups/member?group_id=1&user_id=1
URI Parameters
HideShow
group_id
number (required) Example: 1

Group identity number

user_id
number (required) Example: 1

Member or invited user identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "This member has been successfully removed from the group."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Waiting Members

Get Waiting Members
GET/groups/waiting_members{?group_id,limit,page}

Get waiting members of a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/waiting_members?group_id=1&limit=10&page=1
URI Parameters
HideShow
group_id
number (required) Example: 1

Group identity number

limit
number (optional) Example: 10

Set the number of members in response

page
number (optional) Example: 1

Page number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      },
      "status": "Hello, world!",
      "membership": "owner",
      "waiting_type": "invited"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Approve Member

Approve Member
POST/groups/approve_member

Approve a membership request.

Scope groups

Example URI

POST http://example.com/api/v1/groups/approve_member
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "group_id": 1,
  "user_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "group_id": {
      "type": "number",
      "description": "Group identity number"
    },
    "user_id": {
      "type": "number",
      "description": "Requested user identity number"
    }
  },
  "required": [
    "group_id",
    "user_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "This member's group request has been approved."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Reject Member

Reject Member
POST/groups/reject_member

Reject a membership request.

Scope groups

Example URI

POST http://example.com/api/v1/groups/reject_member
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "group_id": 1,
  "user_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "group_id": {
      "type": "number",
      "description": "Group identity number"
    },
    "user_id": {
      "type": "number",
      "description": "Requested user identity number"
    }
  },
  "required": [
    "group_id",
    "user_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have ignored the invite to the group <a href=\"http://example.com/group/1\">ABC Group</a>"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Categories

Get Categories
GET/groups/categories

Get available group categories.

Scope groups

Example URI

GET http://example.com/api/v1/groups/categories
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Arts & Culture"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Category list"
    }
  }
}

Groups View Options

Get View Options
GET/groups/view_options

Get available group view privacy options.

Scope groups

Example URI

GET http://example.com/api/v1/groups/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Groups Comment Options

Get Comment Options
GET/groups/comment_options

Get available group comment privacy options.

Scope groups

Example URI

GET http://example.com/api/v1/groups/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Groups Photo Options

Get Photo Options
GET/groups/photo_options

Get available privacy options of uploading photos to a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/photo_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Groups Event Options

Get Event Options
GET/groups/event_options

Get available privacy options of creating events for a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/event_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Groups Join

Join Group
POST/groups/join

Join a group.

Scope groups

Example URI

POST http://example.com/api/v1/groups/join
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You are now a member of this group."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Request

Request Membership
POST/groups/request

Request membership of a group.

Scope groups

Example URI

POST http://example.com/api/v1/groups/request
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your group membership request has been sent."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Cancel

Cancel Membership Request
POST/groups/cancel

Cancel request membership of a group.

Scope groups

Example URI

POST http://example.com/api/v1/groups/cancel
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Group membership request cancelled."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Leave

Leave Group
POST/groups/leave

Leave a group.

Scope groups

Example URI

POST http://example.com/api/v1/groups/leave
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have successfully left this group."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Accept

Accept Membership Request
POST/groups/accept

Accept a membership invitation.

Scope groups

Example URI

POST http://example.com/api/v1/groups/accept
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have accepted the invite to the group <a href=\"http://example.com/group/1\">ABC Group</a>"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Reject

Ignore Membership Request
POST/groups/reject

Reject a membership invitation.

Scope groups

Example URI

POST http://example.com/api/v1/groups/reject
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "You have ignored the invite to the group <a href=\"http://example.com/group/1\">ABC Group</a>"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Invite

Get Can Invite Friends
GET/groups/invite{?id}

Get a list of friends who user can invite.

Scope groups

Example URI

GET http://example.com/api/v1/groups/invite?id=1
URI Parameters
HideShow
id
number (required) Example: 1

Group identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Member list"
    }
  }
}

Invite Friends
POST/groups/invite

Invite friends to a group.

Scope groups

Example URI

POST http://example.com/api/v1/groups/invite
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "user_ids": "1,2"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Group identity number"
    },
    "user_ids": {
      "type": "string",
      "description": "Identity numbers of friends, separate them by comma"
    }
  },
  "required": [
    "id",
    "user_ids"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected members have been successfully invited."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Groups Photos

Get Photos
GET/groups/photos{?group_id,limit,page,fields}

Get photos of a group.

Scope groups

Example URI

GET http://example.com/api/v1/groups/photos?group_id=1&limit=8&page=1&fields=id
URI Parameters
HideShow
group_id
number (required) Example: 1

Group identity number

limit
number (optional) Example: 8

Set the number of photos in response

page
number (optional) Example: 1

Page number of photos

fields
string (optional) Example: id

Photo fields can be get, separate them by comma

Choices: id type thumb img title description date group photo_index next_photo previous_photo can_tag can_edit can_delete can_share can_report can_make_profile_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array"
    }
  }
}

Add Photos
POST/groups/photos

Add uploaded photos to group.

  • Use Upload Photo to upload photo and get it’s identity number.

Scope groups

Example URI

POST http://example.com/api/v1/groups/photos
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "group_id": 1,
  "ids": "1,2"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "group_id": {
      "type": "number",
      "description": "Group identity number"
    },
    "ids": {
      "type": "string",
      "description": "Uploaded photo's identity numbers, separate them by comma"
    }
  },
  "required": [
    "group_id",
    "ids"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Groups Photo

Get Photo
GET/groups/photos/{id}{?fields}

Get photo details.

Scope groups

Example URI

GET http://example.com/api/v1/groups/photos/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

fields
string (optional) Example: id

Photo fields can be get, separate them by comma

Choices: id type thumb img title description date group photo_index next_photo previous_photo can_tag can_edit can_delete can_share can_report can_make_profile_photo

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png",
    "img": "http://example.com/images/123.jpg",
    "title": "Hello, world!",
    "description": "Hello, world!",
    "date": "2016-03-02 15:04:38",
    "group": {
      "id": 1,
      "type": "group",
      "title": "Hello, world!",
      "description": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "total_photo": 1
    },
    "photo_index": 0,
    "next_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "previous_photo": {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_photo_thumb_normal.png"
    },
    "can_tag": true,
    "can_edit": true,
    "can_delete": true,
    "can_share": true,
    "can_report": true,
    "can_make_profile_photo": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "thumb": {
          "type": "string",
          "description": "Photo thumbnail"
        },
        "img": {
          "type": "string",
          "description": "Photo URL"
        },
        "title": {
          "type": "string",
          "description": "Photo title"
        },
        "description": {
          "type": "string",
          "description": "Photo caption"
        },
        "date": {
          "type": "string",
          "description": "Last modified date time"
        },
        "group": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Group identity number"
            },
            "type": {
              "type": "string",
              "description": "Item type"
            },
            "title": {
              "type": "string",
              "description": "Group title"
            },
            "description": {
              "type": "string",
              "description": "Group description"
            },
            "owner": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "number",
                  "description": "Owner identity number"
                },
                "type": {
                  "type": "string",
                  "description": "Owner type"
                },
                "title": {
                  "type": "string",
                  "description": "Owner title"
                },
                "imgs": {
                  "type": "object",
                  "properties": {
                    "icon": {
                      "type": "string",
                      "description": "Photo in icon size"
                    },
                    "normal": {
                      "type": "string",
                      "description": "Photo in normal size"
                    },
                    "profile": {
                      "type": "string",
                      "description": "Photo in profile size"
                    },
                    "original": {
                      "type": "string",
                      "description": "Photo in original size"
                    }
                  },
                  "description": "Owner photos"
                }
              },
              "description": "Group owner"
            },
            "total_photo": {
              "type": "number",
              "description": "Group's photos count (available if not a message's photo)"
            }
          },
          "description": "Group of this photo"
        },
        "photo_index": {
          "type": "number",
          "description": "The index of photo in group (start with 0)"
        },
        "next_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The next photo in group"
        },
        "previous_photo": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Photo identity number"
            },
            "thumb": {
              "type": "string",
              "description": "Photo thumbnail"
            }
          },
          "description": "The previous photo in group"
        },
        "can_tag": {
          "type": "boolean",
          "description": "Can tag on this photo"
        },
        "can_edit": {
          "type": "boolean",
          "description": "Can edit this photo"
        },
        "can_delete": {
          "type": "boolean",
          "description": "Can delete this photo"
        },
        "can_share": {
          "type": "boolean",
          "description": "Can share this photo"
        },
        "can_report": {
          "type": "boolean",
          "description": "Can report this photo"
        },
        "can_make_profile_photo": {
          "type": "boolean",
          "description": "Can make this photo as the profile photo"
        }
      }
    }
  }
}

Edit Photo
POST/groups/photos/{id}

Edit a photo’s info.

Scope groups

Example URI

POST http://example.com/api/v1/groups/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Title of this photo."
    },
    "description": {
      "type": "string",
      "description": "Description of this photo."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your changes have been saved."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Delete Photo
DELETE/groups/photos/{id}

Delete a photo.

Scope groups

Example URI

DELETE http://example.com/api/v1/groups/photos/1
URI Parameters
HideShow
id
number (required) Example: 1

Photo identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The photo has been successfully deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Upload Photo

Upload Photo
POST/groups/photos_upload

Upload a photo to a group.

File key (required): Filedata

Scope groups

Example URI

POST http://example.com/api/v1/groups/photos_upload
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "group_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "group_id": {
      "type": "number",
      "description": "Group identity number"
    }
  },
  "required": [
    "group_id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "name": "abc123.jpg"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Photo identity number"
        },
        "name": {
          "type": "string",
          "description": "Photo name"
        }
      }
    }
  }
}

Groups Events

Get Events
GET/groups/events{?group_id,limit,page,fields}

Browse events of a group.

See Get Event response for fields description

Scope groups

Example URI

GET http://example.com/api/v1/groups/events?group_id=1&limit=10&page=1&fields=id
URI Parameters
HideShow
group_id
number (required) Example: 1

Group identity number

limit
number (optional) Example: 10

Set the number of events in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Event fields can be get, separate them by comma

Choices: id thumb title owner description total_member can_edit can_delete can_request can_join can_leave can_cancel can_accept can_reject can_invite can_compose

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "thumb": "http://example.com/images/nophoto_event_thumb_normal.png",
      "title": "Hello, world!",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "description": "Hello, world!",
      "total_member": 1,
      "start_datetime": "May 26, 2016 2:00 PM BST"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Event list"
    }
  }
}

Messages

Message APIs

Inbox

Inbox
GET/messages/inbox{?page,limit,fields}

Get the inbox messages of authorized user.

Scope messages

Example URI

GET http://example.com/api/v1/messages/inbox?page=1&limit=10&fields=id
URI Parameters
HideShow
page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of messages in response

fields
string (optional) Example: id

Other fields can be get, separate them by comma

Choices: id title body participant date read

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Hello, world!",
      "body": "Hello, world!",
      "participant": {
        "img": "http://example.com/images/avatar-default.png",
        "title": "Hello, world!",
        "type": "group"
      },
      "date": "2016-03-02 15:04:38",
      "read": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Conversation list"
    }
  }
}

Sent Messages

Sent Messages
GET/messages/outbox{?page,limit,fields}

Get the outbox messages of the authorized user.

Scope messages

Example URI

GET http://example.com/api/v1/messages/outbox?page=1&limit=10&fields=id
URI Parameters
HideShow
page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of messages in response

fields
string (optional) Example: id

Other fields can be get, separate them by comma

Choices: id title body participant date read

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Hello, world!",
      "body": "Hello, world!",
      "participant": {
        "img": "http://example.com/images/avatar-default.png",
        "title": "Hello, world!",
        "type": "group"
      },
      "date": "2016-03-02 15:04:38",
      "read": true
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Conversation list"
    }
  }
}

Conversation Detail

Conversation Detail
GET/messages/{id}{?fields}

Get all of the information and messages in a conversation.

Scope messages

Example URI

GET http://example.com/api/v1/messages/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Conversation identity number

fields
string (optional) Example: id

Other fields can be get, separate them by comma

Choices: id title body recipients date read messages can_reply

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Hello, world!",
    "body": "Hello, world!",
    "recipients": [
      {
        "id": 2,
        "title": "Jane Doe",
        "type": "user"
      }
    ],
    "date": "2016-03-02 15:04:38",
    "read": true,
    "messages": [
      {
        "id": 1,
        "from": {
          "id": 1,
          "title": "John Doe",
          "img": "http://example.com/images/avatar-default.png"
        },
        "date": "2016-03-03 02:38:29",
        "body": "Hello, world!",
        "attachment": {
          "id": 1,
          "type": "video",
          "title": "Hello, world!",
          "description": "Hello, world!",
          "img": "http://example.com/public/video/c3/00c3_8068.jpg?c=575b",
          "src": "https://player.vimeo.com/video/123456789"
        },
        "conversation": {
          "id": 1,
          "title": "Hello, world!",
          "body": "Hello, world!",
          "participant": {
            "img": "http://example.com/images/avatar-default.png",
            "title": "Hello, world!",
            "type": "group"
          },
          "date": "2016-03-02 15:04:38",
          "read": true
        }
      }
    ],
    "can_reply": true
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Conversation identity number"
        },
        "title": {
          "type": "string",
          "description": "Conversation subject"
        },
        "body": {
          "type": "string",
          "description": "Preview content"
        },
        "recipients": {
          "type": "array",
          "description": "Recipient list"
        },
        "date": {
          "type": "string",
          "description": "Conversation date"
        },
        "read": {
          "type": "boolean",
          "description": "Read status"
        },
        "messages": {
          "type": "array",
          "description": "Message list"
        },
        "can_reply": {
          "type": "boolean",
          "description": "Reply permission"
        }
      },
      "description": "Conversation detail"
    }
  }
}

Message

Compose Message
POST/messages

Compose a new message.

Use the following APIs to add attachment

Scope messages

Example URI

POST http://example.com/api/v1/messages
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "to": "2,3",
  "title": "Hello, world!",
  "body": "Hello, world!",
  "attachment[type]": "photo",
  "attachment[photo_id]": 1,
  "attachment[uri]": "http://abc.com",
  "attachment[title]": "Hello, world!",
  "attachment[description]": "Hello, world!",
  "attachment[thumb]": "http://abc.com/img/123.jpg",
  "attachment[song_id]": 1,
  "attachment[video_id]": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "to": {
      "type": "string",
      "description": "Recipient identity, separated by comma"
    },
    "title": {
      "type": "string",
      "description": "Conversation Subject"
    },
    "body": {
      "type": "string",
      "description": "Message content"
    },
    "attachment[type]": {
      "type": "string",
      "enum": [
        "photo",
        "link",
        "music",
        "video"
      ],
      "description": "Attachment type"
    },
    "attachment[photo_id]": {
      "type": "number",
      "description": "Attachment photo identity number (if `attachment[type]` is `photo` or `video`)"
    },
    "attachment[uri]": {
      "type": "string",
      "description": "Attachment URL (if `attachment[type]` is `link`)"
    },
    "attachment[title]": {
      "type": "string",
      "description": "Attachment title (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[description]": {
      "type": "string",
      "description": "Attachment description (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[thumb]": {
      "type": "string",
      "description": "Link thumbnail (if `attachment[type]` is `link`)"
    },
    "attachment[song_id]": {
      "type": "number",
      "description": "Uploaded song identity number (if `attachment[type]` is `music`)"
    },
    "attachment[video_id]": {
      "type": "number",
      "description": "Added video identity number (if `attachment[type]` is `video`)"
    }
  },
  "required": [
    "to",
    "title",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Hello, world!",
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        },
        "id": {
          "type": "number",
          "description": "Conversation identity number"
        }
      }
    }
  }
}

Delete Message
DELETE/messages{?ids}

Delete one or more conversations.

Scope messages

Example URI

DELETE http://example.com/api/v1/messages?ids=1,2
URI Parameters
HideShow
ids
string (required) Example: 1,2

Conversation identities, separated by comma

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "The selected messages have been deleted."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Send Reply

Send Reply
POST/messages/reply

Send a reply in message conversation.

Use the following APIs to add attachment

Scope messages

Example URI

POST http://example.com/api/v1/messages/reply
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1,
  "body": "Hello, world!",
  "attachment[type]": "photo",
  "attachment[photo_id]": 1,
  "attachment[uri]": "http://abc.com",
  "attachment[title]": "Hello, world!",
  "attachment[description]": "Hello, world!",
  "attachment[thumb]": "http://abc.com/img/123.jpg",
  "attachment[song_id]": 1,
  "attachment[video_id]": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Conversation identity number"
    },
    "body": {
      "type": "string",
      "description": "Message"
    },
    "attachment[type]": {
      "type": "string",
      "enum": [
        "photo",
        "link",
        "music",
        "video"
      ],
      "description": "Attachment type"
    },
    "attachment[photo_id]": {
      "type": "number",
      "description": "Attachment photo identity number (if `attachment[type]` is `photo` or `video`)"
    },
    "attachment[uri]": {
      "type": "string",
      "description": "Attachment URL (if `attachment[type]` is `link`)"
    },
    "attachment[title]": {
      "type": "string",
      "description": "Attachment title (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[description]": {
      "type": "string",
      "description": "Attachment description (if `attachment[type]` is `link` or `video`)"
    },
    "attachment[thumb]": {
      "type": "string",
      "description": "Link thumbnail (if `attachment[type]` is `link`)"
    },
    "attachment[song_id]": {
      "type": "number",
      "description": "Uploaded song identity number (if `attachment[type]` is `music`)"
    },
    "attachment[video_id]": {
      "type": "number",
      "description": "Added video identity number (if `attachment[type]` is `video`)"
    }
  },
  "required": [
    "id",
    "body"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Music

Music APIs

Playlists

Get Playlists
GET/music{?keywords,sort,user_id,limit,page,fields}

Browse music playlists.

Scope music

Example URI

GET http://example.com/api/v1/music?keywords=abc&sort=recent&user_id=1&limit=28&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) Example: abc

Search playlists

sort
string (optional) Example: recent

Browse By

  • recent - Most Recent

  • popular - Most Popular

user_id
number (optional) Example: 1

Get playlists of an user

limit
number (optional) Example: 28

Set the number of playlists in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Video fields can be get, separate them by comma

Choices: id title description thumb owner date total_comment total_view

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Hello, world!",
      "description": "Hello, world!",
      "thumb": "http://example.com/images/nophoto_playlist_main.png",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "date": "2016-03-02 15:04:38",
      "total_like": 1,
      "total_comment": 1,
      "total_view": 1,
      "songs": [
        {
          "id": 1,
          "title": "Hello, world!",
          "play_count": 1,
          "song_url": "http://example.com/files/song.mp3"
        }
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Playlist list"
    }
  }
}

Upload Music
POST/music

Create a new playlist.

File key (optional): art - Playlist photo

Scope music

Example URI

POST http://example.com/api/v1/music
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "song_ids": "1,2",
  "title": "Hello, world!",
  "description": "Hello, world!",
  "search": 1,
  "auth_view": "everyone",
  "auth_comment": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "song_ids": {
      "type": "string",
      "description": "Identity numbers of the uploaded song files which want to add, separate them by comma"
    },
    "title": {
      "type": "string",
      "description": "Title of the new playlist."
    },
    "description": {
      "type": "string",
      "description": "Description of the new playlist."
    },
    "search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show the new playlist in search results. 1 is show and 0 is not show."
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see the new album."
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on the new album."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Playlist identity number"
        }
      }
    }
  }
}

Authorized User Playlists

Get Authorized User Playlists
GET/music/my{?keywords,sort,limit,page,fields}

Get authorized user’s playlists (My Music).

Scope music

Example URI

GET http://example.com/api/v1/music/my?keywords=abc&sort=recent&limit=10&page=1&fields=id
URI Parameters
HideShow
keywords
string (optional) Example: abc

Search playlists

sort
string (optional) Example: recent

Browse By

  • recent - Most Recent

  • popular - Most Popular

limit
number (optional) Example: 10

Set the number of playlists in response

page
number (optional) Example: 1

Page number

fields
string (optional) Example: id

Video fields can be get, separate them by comma

Choices: id title description thumb owner date total_comment total_view

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Hello, world!",
      "description": "Hello, world!",
      "thumb": "http://example.com/images/nophoto_playlist_main.png",
      "owner": {
        "id": 1,
        "type": "user",
        "title": "John Doe",
        "imgs": {
          "icon": "http://example.com/images/avatar-default-icon.png",
          "normal": "http://example.com/images/avatar-default-normal.png",
          "profile": "http://example.com/images/avatar-default-profile.png",
          "original": "http://example.com/images/avatar-default.png"
        }
      },
      "date": "2016-03-02 15:04:38",
      "total_like": 1,
      "total_comment": 1,
      "total_view": 1,
      "songs": [
        {
          "id": 1,
          "title": "Hello, world!",
          "play_count": 1,
          "song_url": "http://example.com/files/song.mp3"
        }
      ]
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Playlist list"
    }
  }
}

Playlist

Get Playlist
GET/music/{id}{?fields}

Get details of a playlist.

Scope music

Example URI

GET http://example.com/api/v1/music/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

Playlist identity number

fields
string (optional) Example: id

Playlist fields can be get, separate them by comma

Choices: id title description thumb owner date total_comment total_view can_edit can_delete

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Hello, world!",
    "description": "Hello, world!",
    "thumb": "http://example.com/images/nophoto_playlist_main.png",
    "owner": {
      "id": 1,
      "type": "user",
      "title": "John Doe",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      }
    },
    "date": "2016-03-02 15:04:38",
    "total_like": 1,
    "total_comment": 1,
    "total_view": 1,
    "songs": [
      {
        "id": 1,
        "title": "Hello, world!",
        "play_count": 1,
        "song_url": "http://example.com/files/song.mp3"
      }
    ]
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "Playlist identity number"
        },
        "title": {
          "type": "string",
          "description": "Playlist title"
        },
        "description": {
          "type": "string",
          "description": "Playlist description"
        },
        "thumb": {
          "type": "string",
          "description": "Playlist thumbnail"
        },
        "owner": {
          "type": "object",
          "properties": {
            "id": {
              "type": "number",
              "description": "Owner identity number"
            },
            "type": {
              "type": "string",
              "description": "Owner type"
            },
            "title": {
              "type": "string",
              "description": "Owner title"
            },
            "imgs": {
              "type": "object",
              "properties": {
                "icon": {
                  "type": "string",
                  "description": "Photo in icon size"
                },
                "normal": {
                  "type": "string",
                  "description": "Photo in normal size"
                },
                "profile": {
                  "type": "string",
                  "description": "Photo in profile size"
                },
                "original": {
                  "type": "string",
                  "description": "Photo in original size"
                }
              },
              "description": "Owner photos"
            }
          },
          "description": "Playlist owner"
        },
        "date": {
          "type": "string",
          "description": "Creation date"
        },
        "total_like": {
          "type": "number",
          "description": "Total like"
        },
        "total_comment": {
          "type": "number",
          "description": "Total comment"
        },
        "total_view": {
          "type": "number",
          "description": "Total view"
        },
        "songs": {
          "type": "array"
        }
      },
      "description": "Playlist detail"
    }
  }
}

Edit Playlist
POST/music/{id}

Edit a playlist.

Scope music

Example URI

POST http://example.com/api/v1/music/1
URI Parameters
HideShow
id
number (required) Example: 1

Playlist identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!",
  "description": "Hello, world!",
  "search": 1,
  "auth_view": "everyone",
  "auth_comment": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "Playlist title"
    },
    "description": {
      "type": "string",
      "description": "Playlist description"
    },
    "search": {
      "type": "number",
      "enum": [
        1,
        0
      ],
      "description": "Show this playlist in search results"
    },
    "auth_view": {
      "type": "string",
      "description": "Who may see this playlist."
    },
    "auth_comment": {
      "type": "string",
      "description": "Who may post comments on this playlist."
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Playlist
DELETE/music/{id}

Delete a playlist.

Scope music

Example URI

DELETE http://example.com/api/v1/music/1
URI Parameters
HideShow
id
number (required) Example: 1

Playlist identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Upload Song

Upload Song
POST/music/songs

Upload a song while creating playlist.

File key (required): Filedata

Scope music

Example URI

POST http://example.com/api/v1/music/songs
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "song_id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "song_id": {
          "type": "number",
          "description": "Song file identity number"
        }
      }
    }
  }
}

Song

Rename Song
POST/music/songs/{id}

Rename a song.

Scope music

Example URI

POST http://example.com/api/v1/music/songs/1
URI Parameters
HideShow
id
number (required) Example: 1

Song identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "title": "Hello, world!"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "title": {
      "type": "string",
      "description": "New song title"
    }
  },
  "required": [
    "title"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Delete Song
DELETE/music/songs/{id}

Delete a song.

Scope music

Example URI

DELETE http://example.com/api/v1/music/songs/1
URI Parameters
HideShow
id
number (required) Example: 1

Song identity number

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Add Song To Playlist

Add Song To Playlist
POST/music/add_song

Upload a song and add to a playlist.

File key (required): Filedata

Scope music

Example URI

POST http://example.com/api/v1/music/add_song
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "playlist_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "playlist_id": {
      "type": "number",
      "description": "Playlist id to add song to."
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "song_id": 1
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "song_id": {
          "type": "number",
          "description": "Song file identity number"
        }
      }
    }
  }
}

Add Song

Compose Upload
POST/music/compose_upload

Upload a song to use as an attachment for updating status.

File key (required): Filedata

Scope music

Example URI

POST http://example.com/api/v1/music/compose_upload
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "type": "wall",
  "Filename": "abc.mp3"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "enum": [
        "wall",
        "profile",
        "message"
      ],
      "description": "Composer type"
    },
    "Filename": {
      "type": "string",
      "description": "File name"
    }
  },
  "required": [
    "Filename"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Hello, world!",
    "playlist_id": 1,
    "song_id": 1,
    "song_title": "Hello, world!",
    "song_url": "http://example.com/song/abc.mp3"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        },
        "playlist_id": {
          "type": "number",
          "description": "Playlist identity"
        },
        "song_id": {
          "type": "number",
          "description": "Song identity"
        },
        "song_title": {
          "type": "string",
          "description": "Song title"
        },
        "song_url": {
          "type": "string",
          "description": "Song URL"
        }
      }
    }
  }
}

Music View Options

Get View Options
GET/music/view_options

Get available music view privacy options.

Scope music

Example URI

GET http://example.com/api/v1/music/view_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Music Comment Options

Get Comment Options
GET/music/comment_options

Get available music comment privacy options.

Scope music

Example URI

GET http://example.com/api/v1/music/comment_options
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": "everyone",
      "title": "Everyone"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Privacy options"
    }
  }
}

Notifications

Notification APIs

Notifications

Get Notifications
GET/notifications{?page,limit,type,fields}

Get notifications of the authorized user.

Scope activities

Example URI

GET http://example.com/api/v1/notifications?page=1&limit=10&type=update&fields=id
URI Parameters
HideShow
page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of items in response

type
string (optional) Example: update

Type of notifications, get all types of notification if this parameter is not defined

  • update - Get all types of notification except friend requests

  • friend_request - Get notification of friend requests only

fields
string (optional) Example: id

Other fields can be get, separate them by comma

Choices: id content owner read timestamp type

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "content": "You and <a class=\"feed_item_username\" href=\"/profile/jane\">Jane Doe</a> are now friends.",
      "owner": {
        "id": 2,
        "title": "Jane Doe",
        "img": "http://example.com/images/avatar-default.png"
      },
      "read": true,
      "timestamp": 1012345678,
      "type": "friend_accepted"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "Notification list"
    }
  }
}

Mark Read

Mark Read
POST/notifications/mark_read

Mark notification as read.

Scope activities

Example URI

POST http://example.com/api/v1/notifications/mark_read
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "number",
      "description": "Notification identity number"
    }
  },
  "required": [
    "id"
  ]
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Mark All Read

Mark All Read
POST/notifications/mark_all_read

Mark all notifications as read.

Scope activities

Example URI

POST http://example.com/api/v1/notifications/mark_all_read
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Users

User (Member) APIs

Users

Get Users
GET/users{?page,limit,keywords,gender_label,age_min,age_max,has_photo,is_online,fields}

Get a list of available users. Users can also be browsed by keywords, gender, age, and other profile fields.

See Get User response for fields description

Scope basic

Example URI

GET http://example.com/api/v1/users?page=1&limit=10&keywords=John&gender_label=Male&age_min=0&age_max=0&has_photo=0&is_online=0&fields=id
URI Parameters
HideShow
page
number (optional) Example: 1

Page number

limit
number (optional) Example: 10

Set the number of users in response

keywords
string (optional) Example: John

Search for users that contains this keyword in their name

gender_label
number (optional) Example: Male

Specify the gender of searching users

  • Male

  • Female

age_min
number (optional) Example: 0

Specify the minimum age of searching users

age_max
number (optional) Example: 0

Specify the maximum age of searching users

has_photo
number (optional) Example: 0

Only search for users that have profile photos

  • 0 - Default

  • 1 - With photos

is_online
number (optional) Example: 0

Only search for users that are currently online

  • 0 - Default

  • 1 - Online

fields
string (optional) Example: id

Other profile fields can be get, separate them by comma

Choices: id title about_me aim birthdate block_status can_comment can_send_message can_view email facebook first_name friend_status gender_label imgs last_name locale locale_label timezone timezone_label total_friend total_mutual_friend total_photo twitter username website

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": [
    {
      "id": 1,
      "title": "Hello, world!",
      "about_me": "Hello, world!",
      "aim": "Hello, world!",
      "birthdate": "2002-2-3",
      "block_status": "no_block",
      "can_comment": true,
      "can_send_message": true,
      "can_view": true,
      "email": "email@example.com",
      "facebook": "Hello, world!",
      "first_name": "Hello, world!",
      "friend_status": "not_friend",
      "gender_label": "Female",
      "imgs": {
        "icon": "http://example.com/images/avatar-default-icon.png",
        "normal": "http://example.com/images/avatar-default-normal.png",
        "profile": "http://example.com/images/avatar-default-profile.png",
        "original": "http://example.com/images/avatar-default.png"
      },
      "last_name": "Hello, world!",
      "locale": "auto",
      "locale_label": "Automatic",
      "timezone": "US/Pacific",
      "timezone_label": "(UTC-8) Pacific Time (US & Canada)",
      "total_friend": 1,
      "total_mutual_friend": 1,
      "total_photo": 1,
      "twitter": "Hello, world!",
      "username": "Hello, world!",
      "website": "Hello, world!"
    }
  ]
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "array",
      "description": "User list"
    }
  }
}

User

Get User
GET/users/{id}{?fields}

Get user’s profile information such as: ID, Title, About Me, Birthdate, etc.

Scope basic

Example URI

GET http://example.com/api/v1/users/1?fields=id
URI Parameters
HideShow
id
number (required) Example: 1

User identity number

fields
string (optional) Example: id

Other profile fields can be get, separate them by comma

Choices: id title about_me aim birthdate block_status can_comment can_send_message can_view email facebook first_name friend_status gender_label imgs last_name locale locale_label timezone timezone_label total_friend total_mutual_friend total_photo twitter username website

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Hello, world!",
    "about_me": "Hello, world!",
    "aim": "Hello, world!",
    "birthdate": "2002-2-3",
    "block_status": "no_block",
    "can_comment": true,
    "can_send_message": true,
    "can_view": true,
    "email": "email@example.com",
    "facebook": "Hello, world!",
    "first_name": "Hello, world!",
    "friend_status": "not_friend",
    "gender_label": "Female",
    "imgs": {
      "icon": "http://example.com/images/avatar-default-icon.png",
      "normal": "http://example.com/images/avatar-default-normal.png",
      "profile": "http://example.com/images/avatar-default-profile.png",
      "original": "http://example.com/images/avatar-default.png"
    },
    "last_name": "Hello, world!",
    "locale": "auto",
    "locale_label": "Automatic",
    "timezone": "US/Pacific",
    "timezone_label": "(UTC-8) Pacific Time (US & Canada)",
    "total_friend": 1,
    "total_mutual_friend": 1,
    "total_photo": 1,
    "twitter": "Hello, world!",
    "username": "Hello, world!",
    "website": "Hello, world!"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "User identity number"
        },
        "title": {
          "type": "string",
          "description": "User title"
        },
        "about_me": {
          "type": "string",
          "description": "About me"
        },
        "aim": {
          "type": "string",
          "description": "AIM"
        },
        "birthdate": {
          "type": "string",
          "description": "Birthday"
        },
        "block_status": {
          "type": "string",
          "enum": [
            "no_block",
            "is_blocked",
            "is_blocked_by"
          ],
          "description": "Blocking status"
        },
        "can_comment": {
          "type": "boolean",
          "description": "Permission to comment on profile"
        },
        "can_send_message": {
          "type": "boolean",
          "description": "Permission to send message"
        },
        "can_view": {
          "type": "boolean",
          "description": "Permission to view profile"
        },
        "email": {
          "type": "string",
          "description": "Email"
        },
        "facebook": {
          "type": "string",
          "description": "Facebook"
        },
        "first_name": {
          "type": "string",
          "description": "First name"
        },
        "friend_status": {
          "type": "string",
          "enum": [
            "not_friend",
            "is_sent_request",
            "is_sent_request_by",
            "is_friend"
          ],
          "description": "Friendship status"
        },
        "gender_label": {
          "type": "string",
          "description": "Gender"
        },
        "imgs": {
          "type": "object",
          "properties": {
            "icon": {
              "type": "string"
            },
            "normal": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "original": {
              "type": "string"
            }
          },
          "description": "User photos"
        },
        "last_name": {
          "type": "string",
          "description": "Last name"
        },
        "locale": {
          "type": "string",
          "description": "Locale id"
        },
        "locale_label": {
          "type": "string",
          "description": "Locale label"
        },
        "timezone": {
          "type": "string",
          "description": "Timezone"
        },
        "timezone_label": {
          "type": "string",
          "description": "Timezone label"
        },
        "total_friend": {
          "type": "number",
          "description": "Total number of friends"
        },
        "total_mutual_friend": {
          "type": "number",
          "description": "Total number of mutual friends"
        },
        "total_photo": {
          "type": "number",
          "description": "Total nunber of photos"
        },
        "twitter": {
          "type": "string",
          "description": "Twitter"
        },
        "username": {
          "type": "string",
          "description": "Username"
        },
        "website": {
          "type": "string",
          "description": "Website"
        }
      },
      "description": "User data"
    }
  }
}

User Info

Edit User Info
POST/users/{id}/info

Edit user’s personal information.

Scope settings

Example URI

POST http://example.com/api/v1/users/1/info
URI Parameters
HideShow
id
number (required) Example: 1

User identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "first_name": "Hello, world!",
  "last_name": "Hello, world!",
  "gender": "Female",
  "birthdate": "1990-2-28",
  "website": "http://example.com",
  "twitter": "https://twitter.com/example",
  "facebook": "https://www.facebook.com/example",
  "aim": "https://i.aol.com/example",
  "about_me": "Hello, world!",
  "privacy[first_name]": "everyone",
  "privacy[last_name]": "everyone",
  "privacy[gender]": "everyone",
  "privacy[birthdate]": "everyone",
  "privacy[website]": "everyone",
  "privacy[twitter]": "everyone",
  "privacy[facebook]": "everyone",
  "privacy[aim]": "everyone",
  "privacy[about_me]": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string",
      "description": "First Name"
    },
    "last_name": {
      "type": "string",
      "description": "Last Name"
    },
    "gender": {
      "type": "string",
      "description": "Gender"
    },
    "birthdate": {
      "type": "string",
      "description": "Birthday (Y-m-d)"
    },
    "website": {
      "type": "string",
      "description": "Website"
    },
    "twitter": {
      "type": "string",
      "description": "Twitter"
    },
    "facebook": {
      "type": "string",
      "description": "Facebook"
    },
    "aim": {
      "type": "string",
      "description": "AIM"
    },
    "about_me": {
      "type": "string",
      "description": "About Me"
    },
    "privacy[first_name]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of First Name"
    },
    "privacy[last_name]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Last Name"
    },
    "privacy[gender]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Gender"
    },
    "privacy[birthdate]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Birthday"
    },
    "privacy[website]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Website"
    },
    "privacy[twitter]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Twitter"
    },
    "privacy[facebook]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Facebook"
    },
    "privacy[aim]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of AIM"
    },
    "privacy[about_me]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of About Me"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

User Photo

Add / Edit User Photo
POST/users/{id}/photo

Add / Change user’s profile photo.

File key (optional): Filedata

Scope settings

Example URI

POST http://example.com/api/v1/users/1/photo
URI Parameters
HideShow
id
number (required) Example: 1

User identity number

Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "crop_position_x": 150,
  "crop_position_y": 50,
  "crop_size": 100,
  "crop_photo_width": 400,
  "crop_photo_height": 200
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "crop_position_x": {
      "type": "number",
      "description": "Position x in pixel of the cropping selection"
    },
    "crop_position_y": {
      "type": "number",
      "description": "Position y in pixel of the cropping selection"
    },
    "crop_size": {
      "type": "number",
      "description": "Square size in pixel of the cropping selection"
    },
    "crop_photo_width": {
      "type": "number",
      "description": "The *display* width in pixel of the cropping photo"
    },
    "crop_photo_height": {
      "type": "number",
      "description": "The *display* height in pixel of the cropping photo"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Authorized User

Get Authorized User
GET/users/me{?fields}

Get authorized user’s profile information such as: ID, Title, About Me, Birthdate, etc.

Scope basic

Example URI

GET http://example.com/api/v1/users/me?fields=id
URI Parameters
HideShow
fields
string (optional) Example: id

Other profile fields can be get, separate them by comma

Choices: id title about_me aim birthdate block_status can_comment can_send_message can_view email facebook first_name friend_status gender_label imgs last_name locale locale_label timezone timezone_label total_friend total_mutual_friend total_photo twitter username website

Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "id": 1,
    "title": "Hello, world!",
    "about_me": "Hello, world!",
    "aim": "Hello, world!",
    "birthdate": "2002-2-3",
    "block_status": "no_block",
    "can_comment": true,
    "can_send_message": true,
    "can_view": true,
    "email": "email@example.com",
    "facebook": "Hello, world!",
    "first_name": "Hello, world!",
    "friend_status": "not_friend",
    "gender_label": "Female",
    "imgs": {
      "icon": "http://example.com/images/avatar-default-icon.png",
      "normal": "http://example.com/images/avatar-default-normal.png",
      "profile": "http://example.com/images/avatar-default-profile.png",
      "original": "http://example.com/images/avatar-default.png"
    },
    "last_name": "Hello, world!",
    "locale": "auto",
    "locale_label": "Automatic",
    "timezone": "US/Pacific",
    "timezone_label": "(UTC-8) Pacific Time (US & Canada)",
    "total_friend": 1,
    "total_mutual_friend": 1,
    "total_photo": 1,
    "twitter": "Hello, world!",
    "username": "Hello, world!",
    "website": "Hello, world!"
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "id": {
          "type": "number",
          "description": "User identity number"
        },
        "title": {
          "type": "string",
          "description": "User title"
        },
        "about_me": {
          "type": "string",
          "description": "About me"
        },
        "aim": {
          "type": "string",
          "description": "AIM"
        },
        "birthdate": {
          "type": "string",
          "description": "Birthday"
        },
        "block_status": {
          "type": "string",
          "enum": [
            "no_block",
            "is_blocked",
            "is_blocked_by"
          ],
          "description": "Blocking status"
        },
        "can_comment": {
          "type": "boolean",
          "description": "Permission to comment on profile"
        },
        "can_send_message": {
          "type": "boolean",
          "description": "Permission to send message"
        },
        "can_view": {
          "type": "boolean",
          "description": "Permission to view profile"
        },
        "email": {
          "type": "string",
          "description": "Email"
        },
        "facebook": {
          "type": "string",
          "description": "Facebook"
        },
        "first_name": {
          "type": "string",
          "description": "First name"
        },
        "friend_status": {
          "type": "string",
          "enum": [
            "not_friend",
            "is_sent_request",
            "is_sent_request_by",
            "is_friend"
          ],
          "description": "Friendship status"
        },
        "gender_label": {
          "type": "string",
          "description": "Gender"
        },
        "imgs": {
          "type": "object",
          "properties": {
            "icon": {
              "type": "string"
            },
            "normal": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "original": {
              "type": "string"
            }
          },
          "description": "User photos"
        },
        "last_name": {
          "type": "string",
          "description": "Last name"
        },
        "locale": {
          "type": "string",
          "description": "Locale id"
        },
        "locale_label": {
          "type": "string",
          "description": "Locale label"
        },
        "timezone": {
          "type": "string",
          "description": "Timezone"
        },
        "timezone_label": {
          "type": "string",
          "description": "Timezone label"
        },
        "total_friend": {
          "type": "number",
          "description": "Total number of friends"
        },
        "total_mutual_friend": {
          "type": "number",
          "description": "Total number of mutual friends"
        },
        "total_photo": {
          "type": "number",
          "description": "Total nunber of photos"
        },
        "twitter": {
          "type": "string",
          "description": "Twitter"
        },
        "username": {
          "type": "string",
          "description": "Username"
        },
        "website": {
          "type": "string",
          "description": "Website"
        }
      },
      "description": "User data"
    }
  }
}

Authorized User Info

Edit Authorized User Info
POST/users/me/info

Edit authorized user’s personal information.

Scope settings

Example URI

POST http://example.com/api/v1/users/me/info
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "first_name": "Hello, world!",
  "last_name": "Hello, world!",
  "gender": "Female",
  "birthdate": "1990-2-28",
  "website": "http://example.com",
  "twitter": "https://twitter.com/example",
  "facebook": "https://www.facebook.com/example",
  "aim": "https://i.aol.com/example",
  "about_me": "Hello, world!",
  "privacy[first_name]": "everyone",
  "privacy[last_name]": "everyone",
  "privacy[gender]": "everyone",
  "privacy[birthdate]": "everyone",
  "privacy[website]": "everyone",
  "privacy[twitter]": "everyone",
  "privacy[facebook]": "everyone",
  "privacy[aim]": "everyone",
  "privacy[about_me]": "everyone"
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "first_name": {
      "type": "string",
      "description": "First Name"
    },
    "last_name": {
      "type": "string",
      "description": "Last Name"
    },
    "gender": {
      "type": "string",
      "description": "Gender"
    },
    "birthdate": {
      "type": "string",
      "description": "Birthday (Y-m-d)"
    },
    "website": {
      "type": "string",
      "description": "Website"
    },
    "twitter": {
      "type": "string",
      "description": "Twitter"
    },
    "facebook": {
      "type": "string",
      "description": "Facebook"
    },
    "aim": {
      "type": "string",
      "description": "AIM"
    },
    "about_me": {
      "type": "string",
      "description": "About Me"
    },
    "privacy[first_name]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of First Name"
    },
    "privacy[last_name]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Last Name"
    },
    "privacy[gender]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Gender"
    },
    "privacy[birthdate]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Birthday"
    },
    "privacy[website]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Website"
    },
    "privacy[twitter]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Twitter"
    },
    "privacy[facebook]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of Facebook"
    },
    "privacy[aim]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of AIM"
    },
    "privacy[about_me]": {
      "type": "string",
      "enum": [
        "everyone",
        "registered",
        "friends",
        "self"
      ],
      "description": "Privacy of About Me"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Authorized User Photo

Add / Edit Authorized User Photo
POST/users/me/photo

Add / Change authorized user’s profile photo.

File key (optional): Filedata

Scope settings

Example URI

POST http://example.com/api/v1/users/me/photo
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "crop_position_x": 150,
  "crop_position_y": 50,
  "crop_size": 100,
  "crop_photo_width": 400,
  "crop_photo_height": 200
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "crop_position_x": {
      "type": "number",
      "description": "Position x in pixel of the cropping selection"
    },
    "crop_position_y": {
      "type": "number",
      "description": "Position y in pixel of the cropping selection"
    },
    "crop_size": {
      "type": "number",
      "description": "Square size in pixel of the cropping selection"
    },
    "crop_photo_width": {
      "type": "number",
      "description": "The *display* width in pixel of the cropping photo"
    },
    "crop_photo_height": {
      "type": "number",
      "description": "The *display* height in pixel of the cropping photo"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    }
  }
}

Make Profile Photo

Make Profile Photo
POST/users/me/external_photo

Set user’s profile photo from an existed photo.

Scope settings

Example URI

POST http://example.com/api/v1/users/me/external_photo
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "photo_id": 1
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "photo_id": {
      "type": "number",
      "description": "Identity number of the photo that want to make as profile photo"
    }
  }
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "success": true,
  "data": {
    "message": "Your profile photo has been successfully changed."
  }
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean",
      "description": "Result flag"
    },
    "data": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Result message"
        }
      }
    }
  }
}

Signup

Signup
POST/users/signup

Create a new user.

File key (optional): Filedata

Scope basic

Example URI

POST http://example.com/api/v1/users/signup
Request  with body
HideShow
Headers
Content-Type: multipart/form-data
Body
{
  "email": "email@example.com",
  "password": "examplepassword",
  "username": "johndoe",
  "timezone": "US/Pacific",
  "first_name": "John",
  "last_name": "Doe",
  "gender": "Male",
  "birthdate": "1990-02-29",
  "website": "http://example.com",
  "twitter": "http://example.com",
  "facebook": "http://example.com",
  "aim": "http://example.com",
  "about_me": "Hello, world!",
  "provider": "facebook",
  "uid": "100000123456789",
  "photo_url": "http://example.com/file/abc.jpg",
  "crop_position_x": 150,
  "crop_position_y": 50,
  "crop_size": 100,
  "crop_photo_width": 400,
  "crop_photo_height": 200
}
Schema
{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "description": "User email"
    },
    "password": {
      "type": "string",
      "description": "User password"
    },
    "username": {
      "type": "string",
      "description": "Username"
    },
    "timezone": {
      "type": "string",
      "enum": [
        "US/Pacific",
        "US/Mountain",
        "US/Central",
        "US/Eastern",
        "America/Halifax",
        "America/Anchorage",
        "Pacific/Honolulu",
        "Pacific/Samoa",
        "Etc/GMT-12",
        "Canada/Newfoundland",
        "America/Buenos_Aires",
        "Atlantic/South_Georgia",
        "Atlantic/Azores",
        "Europe/London",
        "Europe/Berlin",
        "Europe/Athens",
        "Europe/Moscow",
        "Iran",
        "Asia/Dubai",
        "Asia/Kabul",
        "Asia/Yekaterinburg",
        "Asia/Calcutta",
        "Asia/Katmandu",
        "Asia/Omsk",
        "Indian/Cocos",
        "Asia/Krasnoyarsk",
        "Asia/Hong_Kong",
        "Asia/Tokyo",
        "Australia/Adelaide",
        "Australia/Sydney",
        "Asia/Magadan",
        "Pacific/Auckland"
      ],
      "description": "User timezone"
    },
    "first_name": {
      "type": "string",
      "description": "First Name"
    },
    "last_name": {
      "type": "string",
      "description": "Last Name"
    },
    "gender": {
      "type": "string",
      "description": "Gender in label, based on site"
    },
    "birthdate": {
      "type": "string",
      "description": "Birthday in format YYYY-MM-DD"
    },
    "website": {
      "type": "string",
      "description": "Website"
    },
    "twitter": {
      "type": "string",
      "description": "Twitter"
    },
    "facebook": {
      "type": "string",
      "description": "Facebook"
    },
    "aim": {
      "type": "string",
      "description": "AIM"
    },
    "about_me": {
      "type": "string",
      "description":