Skip to main content

Player API

Overview​

This API allows you to get the user's player information.

How to Authorize​

To use this API, an access token which retrieve by the grant_type and scope described on the following table must be specified on the Authorization request header.

  • Authorization Type
    • Bearer
  • Supported grant_type
    • client_credentials_grant
  • The necessary scope
    • player:authorizedUsers

Endpoint URL​

Endpoint URL in each environment will be following.

itemdescription
HTTP MethodGET
Request URIsandbox java https://sb-api.andapp.jp/1.0.0/users{/playerId} production java https://api.andapp.jp/1.0.0/users{/playerId}

Request Example​

Request example is as follows.

GET /1.0.0/users/4503599627370495 HTTP/1.1
Host: sb-api.andapp.jp:443
Authorization: Bearer {access_token}

Response Status​

The response status when succeeded is as follows.

statusdescription
200 OKWhen the resource can be returned normally.

Response Header​

Response header is as follows.

namevaluerequireddescription
Content-Typeapplication/jsontrue 

Response Body​

The JSON string with the following parameters is sent. Please refer to the example below for details.

propertytitletyperequireddescription

id

Player IDintegertrue

The player ID of this player.

links

IdP cooperation objectobjecttrue

An object that represents the type of the external Identity Provider that cooperates this player.

links.mobageMobage cooperation objectobjectfalse

An object which exists in the case that this player is connected to the Mobage.

links.mobage.createdAtWhen the day began with carryingintegertrue

The UNIX timestamp value when started to connect this player to the Mobage.

links.mobage.updatedAtCooperation update date and timeintegertrue 
createdAtCreation date and timeintegertrue

The UNIX timestamp when this resource is created.

updatedAtDate Modifiedintegertrue

The UNIX timestamp when this resource is updated.

Response Example (In case that the IdP has already been cooperated)​

HTTP/1.1 200 OK
Content-Type: application/json


{
"id": 4503599627370495,
"links": {
"mobage": {
"createdAt": 1439726867,
"updatedAt": 1439726867
}
},
"createdAt": 1439726867,
"updatedAt": 1439726867
}

Response Example (In case that the IdP is not cooperated yet)​

HTTP/1.1 200 OK
Content-Type: application/json


{
"id": 4503599627370495,
"links": {
},
"createdAt": 1439726867,
"updatedAt": 1439726867
}

Response Example (In case that the IdP has already been cooperated and the InAppUserId has been linked)​

HTTP/1.1 200 OK
Content-Type: application/json

{
"createdAt": 1485255409,
"id": 4503599627370495,
"links": {
"app": {
"createdAt": 1485497186,
"id": "12345",
"updatedAt": 1485502361
},
"mobage": {
"createdAt": 1439726867,
"updatedAt": 1439726867
}
},
"updatedAt": 1485502361
}

Response Example (In case that the IdP is not cooperated yet and the InAppUserId has been linked)​

HTTP/1.1 200 OK
Content-Type: application/json

{
"createdAt": 1485255409,
"id": 4503599627370495,
"links": {
"app": {
"createdAt": 1485497186,
"id": "12345",
"updatedAt": 1485502361
}
},
"updatedAt": 1485502361
}

Response Example (In case that the IdP has already been cooperated and both the InAppUserId and the extras have been linked)​

HTTP/1.1 200 OK
Content-Type: application/json

{
"createdAt": 1487217000,
"id": 5153322583457792,
"links": {
"app": {
"createdAt": 1487246188,
"extras": {
"baz": "qux",
"foo": "bar"
},
"id": "123456",
"updatedAt": 1487246188
},
"mobage": {
"createdAt": 1487232050,
"updatedAt": 1487232050
}
},
"updatedAt": 1487246188
}

Error Response​

Error response will be returned in the application/problem+json format. The status code and the value of the type property of Problem Type is as follows.

statustitletypedescription
400Bad Requestabout:blankIt will be returned when a bad Player ID is specified in the URI Template parameters
404Not Foundabout:blankIt will be returned if a nonexistent Player ID is specified in the URI Template parameters
500Server Errorabout:blankThe error occurs on the API server.
503Service Unavailableabout:blankThe API server can't answer temporary.

Error Response Example​

The example of an error response is as follows.

HTTP/1.1 404 Not Found
Content-Type: application/problem+json

{
"type": "about:blank",
"title": "Not Found",
"code": 404,
"instance": "https://sb-api.andapp.jp/1.0.0/users/4503599627370495"
} 

Change log​

  • 2016/02/15
    • Along with the Player Link API has been added, add the response example
  • 2016/08/01
    • Has been deleted deviceAccounts object from the response.
  • 2016/07/28
    • Created