Skip to main content

Profile

Profile

These endpoints are used to get logged in gamer profile and update gamer data.

info

Base Endpoint: /api/v1/profile

Available Endpoints

1. Get Gamer Profile

  • Method & Path: GET /
  • Description: This endpoint is used to get gamers profile.
  • Headers:
    • Authorization: Bearer token for user authentication.
  • Response Body:
    • id: Unique identifier gamerId
    • displayName: Name of gamer
    • avatar: Avatar of gamer
    • socials: Array of gamer socials that are linked. It contains object of provider i.e., Google, Facebook, or Apple.
    • preference: object of gamer preference that can include any value in object format.
    • stats: array of gamer stat.
      • id: Unique identifier of gamer stat.
      • value: Object that provide highest and total value of state.

cURL Command

curl --request GET \
--url https://api.yarsaplay.com/api/v1/profile \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'

Response Body

{
"avatar": "<string>",
"displayName": "<string>",
"id": "<uuid>",
"preferences": {},
"stats": [
{
"id": "<uuid>",
"value": {
"highest": "<number>",
"total": "<number>"
}
},
{
"id": "<uuid>",
"value": {
"highest": "<number>",
"total": "<number>"
}
}
]
}

2. Update Gamer Profile

  • Method & Path:PATCH /
  • **Description:**This endpoint is used to update gamer profile. Here, only avatar and display name can be updated.
  • Headers:
    • Authorization: Bearer token for user authentication.
  • Request Body:
    • displayName: Display name of gamer
    • avatar: avatar of gamer
  • Response Body:
    • id: Unique Identifier gamerId
    • displayName: Name of gamer
    • avatar: Avatar of gamer
    • socials: Array of gamer socials that are linked. it contains object of provider i.e., Google, Facebook, or Apple.
    • preference: object of gamer preference that can include any value in object format.
    • stats: array of gamer stat.
      • id: Unique identifier of gamer stat.
      • value: Object that provide highest and total value of state.

cURL Command

curl --request PATCH \
--url https://api.yarsaplay.com/api/v1/profile \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json'

Response Body

{
"avatar": "<string>",
"displayName": "<string>",
"id": "<uuid>",
"preferences": {},
"stats": [
{
"id": "<uuid>",
"value": {
"highest": "<number>",
"total": "<number>"
}
},
{
"id": "<uuid>",
"value": {
"highest": "<number>",
"total": "<number>"
}
}
]
}

3. Update Gamer Preference

  • Method & Path: PATCH /preference
  • Description: This endpoint is used to update gamer preference. Game developers can add custom values in this field.
  • Headers:
    • Authorization: Bearer token for user authentication.
  • Request Body:
    • Request body can accept any valid JSON with key value pair.
  • Response Body:
    • Returns JSON as requested body.

cURL Command

curl --request PATCH \
--url https://api.yarsaplay.com/api/v1/profile/preference \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json'

Response Body

JSON object representing values that have been configured for the user.