Gamelearn API (0.2.0)

Download OpenAPI specification:Download

Gamelearn API

Use cases

Get token

In order to get a valid token to use our API, you should send your credential to the authorization url.

Command line

curl -X POST --user id:secret 'https://gamelearn.auth.eu-west-1.amazoncognito.com/oauth2/token?grant_type=client_credentials' -H 'Content-Type: application/x-www-form-urlencoded'

JS

fetch('https://gamelearn.auth.eu-west-1.amazoncognito.com/oauth2/token?grant_type=client_credentials', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Basic ' + btoa(`${id}:${secret}`)
  }
}).then((response) => {
  return response.json();
}).then({ access_token: token }) => {
  return token
});

Authentication

ClientsAPIScopes

Security Scheme Type OAuth2
implicit OAuth Flow
Authorization URL: https://gamelearn.auth.eu-west-1.amazoncognito.com/oauth2/token?grant_type=client_credentials
Scopes:
  • groups:read -

    Read groups

  • licenses:read -

    Read licenses

Get groups

Get groups with pagination

Authorizations:
ClientsAPIScopes (groups:read)
query Parameters
limit
string

number of groups

page
string

number of page

Responses

200

Groups matching pagination options

400

Error

get /groups
https://evr151p8w1.execute-api.eu-west-1.amazonaws.com/integration/groups

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    {
    },
  • "limit": 10,
  • "total": 99,
  • "page": 1,
  • "pages": 10
}

Get group

Get group info

Authorizations:
ClientsAPIScopes (groups:read)
path Parameters
groupId
required
string
Example: 507f1f77bcf86cd799439011

Group id

Responses

200

group detail

400

Error

get /groups/{groupId}
https://evr151p8w1.execute-api.eu-west-1.amazonaws.com/integration/groups/{groupId}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "id": "507f1f77bcf86cd799439011",
  • "name": "Awesome group",
  • "startDate": "2020-01-01T00:00:00.000Z",
  • "endDate": "2020-12-31T23:59:59.999Z",
  • "numberOfLicenses": 10
}

Get licenses

Get licenses with pagination

Authorizations:
ClientsAPIScopes (groups:readlicenses:read)
path Parameters
groupId
required
string
Example: 507f1f77bcf86cd799439011

Group id

Responses

200

licenses matching pagination options

400

Error

get /groups/{groupId}/licenses
https://evr151p8w1.execute-api.eu-west-1.amazonaws.com/integration/groups/{groupId}/licenses

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "items":
    {
    },
  • "limit": 10,
  • "total": 99,
  • "page": 1,
  • "pages": 10
}