People API
This is an API to retrieve user profile information for the current player or other players (that have played your game), or a profile list of the current user's followers.
1. Object Fields
Person
Parameter | Description | Type | Remarks |
---|---|---|---|
id | User ID | Integer | (Basic info) |
nickname | Nickname | String | (Basic info) |
displayName | Same as nickname | String | (Basic info) |
profileUrl | Profile URL | String | (Basic info) |
thumbnailUrl | Thumbnail image URL (Standard/Normal size, 48 x 48) | String | (Basic info) |
userType | User type | String | (Basic info) |
grade | User grade | Integer | (Basic info) |
languagesSpoken | User's language code written in ISO639-1 format (the language he is viewing the site in) | String | (Basic info) |
activeSub | Whether the user has an active subscription on the platform. "1" if yes, "0" if no. This field is NOT available on the sandbox environment at this time. | String | (Basic info) |
2. Constants
userType
Value | Description |
---|---|
staff | Nutaku staff |
developer | Partner's account |
null or empty string | Normal account |
grade
Value | Description |
---|---|
0 | Guest player |
1 | Profile registered (unverified user) |
2 | Verified user (email verified) |
3. Request
3-1. Endpoint URL
/people/{guid}/@self/{appid}/{pid}
3-2. HTTP Method
Method | Function | 3-legged | 2-legged |
---|---|---|---|
GET | Retrieves a Person object | Yes | Yes |
Other than GET | - | - | - |
3-3. Template Parameters
guid (required)
Parameter | Description | Remarks |
---|---|---|
@me | Represents the Nutaku user currently playing the game | To be specified with xoauth_requestor_id in Authorization header. This method can only be used for 3-legged requests, because for 2-legged xoauth_requestor_id holds the Game ID |
{guid} | Arbitrary Nutaku user ID | The specified user needs to have played the game before |
appid (required)
Parameter value | Description | Remarks |
---|---|---|
@app | Represents ID of game being played | |
{app id numeral} | You can manually write the actual app id literal value, but it's always simpler to just use @app instead |
3-4. Query Parameters
fields (optional)
Value | Description | Remarks |
---|---|---|
Arbitrary string | Field name of a Person object to be retrieved | Multiple comma-delimited fields can be specified |
4. Response
Response@self/@app?fields=id,nickname,thumbnailUrl,gender,age
HTTP Method | Response Code | Description |
---|---|---|
GET | 200 | Successful completion of data retrieval |
GET | 400 | Invalid request |
GET | 401 | OAuth failure |
Other than GET | 405 | Unpermitted method |
GET | 500 | Nutaku Game Platform error |
5. Notes
When a retrieval target field becomes an empty string
A targeted field becomes an empty string when it is undefined.
User types
By the userType field of a Person object, you can differentiate between Nutaku or game staff (userType has a non-empty value) and general users (userType is null or empty).
Gold consumption by Nutaku staff are for testing purposes, thus, exclude any of them when you check usage result at the beginning of the month.
6. Samples
6-1. Retrieval of information about the user currently playing the game
Request
GET /social/rest/people/@me/@self/@app?fields=id,nickname
Response
200 OK { "entry": { "id": “123456", "nickname": "Nickname", "isViewer": true, "isOwner": true } }
6-2. Retrieval of information about an arbitrary user by user ID
Request
GET /social/rest/people/12345/@self/@app?fields=id,nickname
Response
200 OK { "entry": { "id": “12345", "nickname": "Nickname", "isViewer": false, "isOwner": false } }