Access
Connect cross-platform accounts & identity management
Swagger is a toolset that simplifies API development by helping you design and document your APIs.
AccelByte uses Swagger to develop and manage its API endpoints (opens new window).
You can get authorization to use Swagger either by using the Admin Portal or by using Curl.
Follow the steps below to get authorization in Swagger, so that you can test our API endpoints (opens new window).
Follow the steps below to get authorization using the Admin Portal:
Open the API endpoint for the service you want to access, for example IAM. You can find the list of our services on the API Endpoints (opens new window) page.
Click the Authorize button in the top-right corner of the screen.
NOTE
You need to type something into the Password field under Basic authorization and then delete it before pressing Authorize. Otherwise, Swagger will denote the password as undefined rather than an empty string, which will prevent logging in.
When you’re finished, click Execute. The access token you need will be returned in the server response.
Copy the contents of the Response body, starting with { “access_token”
from the server response. This will be a very long string, as seen in the image above.
Return to the Available authorizations window by clicking the green Authorize icon in the top-right corner of the Swagger page.
If you use Curl (opens new window), you can also get an access token for Swagger using the code below.
curl -X 'POST' \
'<<base_url>>/iam/v3/oauth/token' \
-H 'accept: application/json' \
-H 'authorization: Basic <<client_credential>>' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'grant_type=password&username=<<username>>&password=<<password>>'
<<base_url>>
with your base URL.<<client_credential>>
with your OAuth Token in the format of client_id:client_secret
, in base64 encoding.<<username>>
with your username.<<password>>
with your password.When you’re finished, click Enter.
Here is an example response to a successful request:
{
"access_token": "string",
"bans": [
{
"ban": "string",
"disabledDate": "2022-09-01T03:19:32.816Z",
"enabled": true,
"endDate": "2022-09-01T03:19:32.816Z",
"targetedNamespace": "string"
}
],
"display_name": "string",
"expires_in": 0,
"is_comply": true,
"jflgs": 0,
"namespace": "string",
"namespace_roles": [
{
"namespace": "string",
"roleId": "string"
}
],
"permissions": [
{
"action": 0,
"resource": "string",
"schedAction": 0,
"schedCron": "string",
"schedRange": [
"string"
]
}
],
"platform_id": "string",
"platform_user_id": "string",
"refresh_expires_in": 0,
"refresh_token": "string",
"roles": [
"string"
],
"scope": "string",
"token_type": "string",
"user_id": "string",
"xuid": "string"
}
TIP
You can copy the access_token value from the response and paste it into Swagger preceded by the word BEARER, as in step 12 of the Using the Admin Portal (opens new window) section above.