Player Endpoints have two main API sections:
Get Player Details
Delete a Player
These two API sections contain specific information comprising various properties whenever the APIs are called.
Get Player Details
This API retrieves all player information for the given gameId
or playerId
. It delivers the player's identification, NFTs, wallet address, and game.
Prerequisites:
Ensure that you have the following requirements ready before calling the
Get Player Details
endpoints:
gameId
to create a player.playerId
: to check a player's detailed information.API Secret
: credential to call the endpoint.API Key
: credential to call the endpoint.You can find each of the requirements above within your ChainEngine console.
Payload Response
The payload from the Get Player Details
endpoint returns the following attributes:
Attribute | Type | Description |
---|---|---|
page | integer | The currently displayed page. |
offset | integer | The offset of the given player information. |
total | integer | The total number of the players found on the given gameId . |
items | An array of strings | The player's information. |
id | string | The playerId of the player. |
gameId | string | The Game ID the player is associated with. |
walletAddress | string | The wallet address of the player. |
details | string | The player's custom properties. |
createdAt | string | The time at which the user first generated the player's identity. |
Endpoint
Below is the available endpoints list for the Get Player Details
:
Endpoint |
---|
Get Game Players - GET/players/game/{gameId} |
Get Player by Id - GET/players/{id} |
Sample Object
An example of the Get Game Players
endpoint result is shown below:
{
"page": 1,
"offset": 0,
"total": 36,
"items": [
{
"id": "0b80f768-77ee-46bf-8ea7-386b15533bcd",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0xAd3E55E740C59951F433Bc7127319E0772b36b18",
"createdAt": "2022-09-05T05:44:02.679Z"
},
{
"id": "327a6728-c42a-4b2d-8fac-5ffab06566c3",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x2Aae54DdA49935fF06C233ffC23FDEbd10D4E3C2",
"createdAt": "2022-09-05T05:51:11.530Z"
},
{
"id": "5d61f99c-b926-437d-b118-9104744a3f6c",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x394d39436a01F140Bc28FEA0738080493DEAC690",
"createdAt": "2022-09-05T06:00:20.547Z"
},
{
"id": "90b1ab6c-7297-473d-9529-ac4f66cecb8a",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x32c45d580DE0F6126941bfb8ff2181e778545E85",
"createdAt": "2022-09-06T15:07:38.304Z"
},
{
"id": "bfb11de3-5e5e-440e-affc-56f14e8a1b45",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x03aefFc2a553E7A375e8B4Ca581494aB49bE0eF6",
"createdAt": "2022-09-06T15:16:44.812Z"
},
{
"id": "fc0345bb-35f3-4382-9849-23d51d52017a",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x02c675be7624FC682A95eB29346722E231B34863",
"createdAt": "2022-09-09T02:57:26.001Z"
},
{
"id": "137b164a-93c9-4fd3-86ae-c17cfd8d09b3",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x02c675be7624FC682A95eB29346722E231B34864",
"createdAt": "2022-09-09T02:59:16.816Z"
},
{
"id": "a4cae06f-4036-4bbe-a579-51f74551c18b",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x02c675be7624FC682A95eB29346722E231B34866",
"createdAt": "2022-09-11T16:47:23.924Z"
},
{
"id": "54910c83-dcda-4de3-958d-38fed3348b75",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x57CDB34EE3520858C849a3de0c276465d3A0095D",
"properties": {
"details": "firstplayer"
},
"createdAt": "2022-09-12T03:37:12.497Z"
},
{
"id": "42babf55-605c-4bf3-a31b-a63c0f9e6f9e",
"gameId": "aa626681-f03a-4c8c-a7c8-294051743c53",
"walletAddress": "0x93dE1B0493A0A9CB5245B44951A7Acc9d6E5f035",
"properties": {
"details": "firstplayer"
},
"createdAt": "2022-09-12T04:01:18.991Z"
}
]
}
Delete a Player
This endpoint deletes a player by playerId
. The player's NFT will not be deleted, but the playerId
information will be deleted and not connected to the game anymore.
Prerequisites:
Ensure that you have the following requirements ready before calling the
Delete a Player
endpoints:
playerId
: to check a player's detailed information.API Secret:
credential to call the endpoint.API Key
: credential to call the endpoint.You can find each of the requirements above within your ChainEngine console.
Payload Response
The payload from the Delete a Player
endpoint returns No attributes
.
Endpoint
Below is the available endpoints list for the Delete a Player
:
Endpoint |
---|
Delete Player by Id - DELETE/players/{id} |
Sample Object
An example object returned by the Delete Player by Id
endpoint is shown below:
Ok