People
Endpoint for Social API
Note: Social API includes Appdata API, Blacklist API, People API, Profanity API, Leaderboard API, Remote Notification API.
Mobage Simplified Chinese Platform
Production Social | http://sp.mobage-platform.cn/social/api/restful/v2 |
Sandbox Social | http://sp.sb.mobage-platform.cn/social/api/restful/v2 |
Environment | URL |
---|
Mobage Traditional Chinese Platform
Environment | URL |
---|---|
Production Social | http://sp.mobage-platform.tw/social/api/restful/v2 |
Sandbox Social | http://sp.sb.mobage-platform.tw/social/api/restful/v2 |
Data Type Definition
User
Name | Type | Description | CN | JP | WW |
---|---|---|---|---|---|
id | UserId | The user's ID value | * | * | * |
displayName | String | The user’s display name (same value as nickname) | * | * | * |
aboutMe | String | Introduction text about the user | * | * | |
addresses | Plural-Field<Address> | Where the user lives (name of prefecture) | * | * | |
age | Number | The user’s age | * | * | * |
birthday | Date | The user’s birthday | * | * | |
gender | String | The user’s gender | * | * | |
hasApp | Boolean | Whether or not the user has installed that application | * | * | * |
interests | Plural-Field<string> | The user’s interests | * | * | |
nickname | String | The user’s nickname | * | * | * |
thumbnailUrl | String | The URL for the user’s thumbnail | * | * | * |
jobType | String | The user’s occupation | * | * | |
bloodType | String | The user’s blood type | * | * | |
ageRestricted | Boolean | Whether or not the user has been restricted by age | * |
Description
This is an API for acquiring user profile information and user friend lists.
URI Fragment
/people/{-list|,|userId}/{groupId}
/people/{-list|,|userId}/{groupId}/{-list|,|personId}
Supported Formats
JSON
HTTP Method
GET
Request Parameters
Name | Type | Required/Optional | Parameter | Description |
---|---|---|---|---|
userId | UserId, Array | Required | URI Template Parameters | @me or direct value |
groupId | GroupId | Required | URI Template Parameters | The only legal values are @all, @self, or @friends. |
personId | UserId, Array | Optional | URI Template Parameters | direct value |
fields | Array | Optional | Query String | the names in the data type User for the CN platform |
format | String | Optional | Query String | Only json is specifiable |
filterBy | String or Array | Optional | Query String | The specifiable fields are id and hasApp |
filterOp | String or Array | Optional | Query String | equals is the only specifiable operator |
filterValue | String or Array | Optional | Query String | The values for filter keys. |
count | Number | Optional | Query String | An integer between 1 and 1000. The default value is 50. |
sortBy | String | Optional | Query String | Only id is specifiable. |
sortOrder | String | Optional | Query String | ascending or descending |
startIndex | Number | Optional | Query String | An integer of 1 or greater |
Request Headers
Any request to the Mobage REST APIs must include the Authorization header. For more details, see How to add the Authorization Header .
Request Body
None
Response Body
- User (in the case of either /people/{userId}/@self or /people/{userId}/@all/{personId}, /people/{userId}/@friends/{personId})
- Collection of Users (in all other cases)
Response Status Code
HTTP Status Code | HTTP Status Message | Meaning |
---|---|---|
200 | OK | Data successfully acquired |
400 | Bad Request | Corrupt request data on the client side |
401 | Unauthorized | Authorization error |
403 | Forbidden | The resource exists, but access is not possible due to a reason other than an authorization error. |
404 | Not Found | The resource doesn’t exist |
500 | Internal Server Error | An error on the API server side |
503 | Service Unavailable | The API cannot be used temporarily |
Notes
If the fields parameters are omitted, the user's ID and nickname are selected. The user ID and nickname are returned in every response.
Example 1. Acquire User Profile Information
Example 2. Acquire a List of the User's Friends
Example 3. Determining whether the Specified User is a Friend
Http Response is as follows if a specified user is a friend:
Http Response is as follows if the user is not a friend.
Example 4. Verify the Current User
1. build a string for OAuth parameters: firstly sort the following parameters alphabetically and URL encode the names and values, then join name and value with "=", finally join name/value pairs with " oauth_token is obtained from the token credential. 2. URL encode the following three parameters. 3. join the encoded parameters with "&". 1. Build a secret by joining the Consumer Secret and the Token Secret (obtained from the token credential) with " 2. Pass the base string and secret to the HMAC-SHA1 hashing algorithm. 3. the output of HMAC-SHA1 hashing algorithm is a binary string. Use base64 encode to produce the signature string. A tool is provided to verify whether your signature is correct. Refer to Oauth Signature Tool. Follow the steps to build the “Authorization” header: 1. URL encode the parameter names and values in the table below 2. Double quote the value, join name and value with "=", join name/value pairs with "," 3. Add realm parameter as an option 4. Add "OAuth " (including the space at the end) to the beginning of the header. oauth_token is obtained from the token credential. How to Add the Authorization Header
Step 1. Create the base string
&"
Parameter Description Value oauth_consumer_key
The Consumer Key for the application Issued when resist the application oauth_nonce
Unique value for each request Generated on the game server oauth_signature_method
Hash method Only HMAC-SHA1
is specifiableoauth_timestamp
UNIX timestamp Generated on the game server oauth_token
The token code oauth_version
OAuth version Only 1.0
Parameter Description Request Method HTTP Method to the API Server API URL URL to the API Server (exclude query parameters) OAuth Parameters A string Built in previous step Step 2. Generate the oauth_signature
&"
.Step 3. Build the Authorization Header
Parameter Value oauth_consumer_key Issued when resist the application oauth_nonce Generated on the game server oauth_signature Generated on the game server, Refer to Step 2. Generate the oauth_signature oauth_signature_method only "HMAC-SHA1" is specifiable oauth_timestamp Generated on the game server oauth_token oauth_version Only 1.0
Authorization Header Example