PUT

/api/users/{handle}/license

Authorization*
curl --request PUT \
  --url https://codecombat.com/api/users/{handle}/license \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{
  "ends": "<ends>"
}'
{
  "_id": "string",
  "email": "string",
  "license": {
    "active": "boolean",
    "ends": "string"
  },
  "name": "string",
  "oAuthIdentities": [
    {
      "id": "string",
      "provider": "string"
    }
  ],
  "role": "string",
  "slug": "string",
  "stats": {
    "concepts": "object",
    "gamesCompleted": "number",
    "playTime": "number"
  },
  "subscription": {
    "active": "boolean",
    "ends": "string"
  }
}
url = `https://codecombat.com/api/users/${userID}/license`
json = { ends: new Date('2017-01-01').toISOString() }
request.put({ url, json, auth }, (err, res) => {
  console.log(res.body.license) // { ends: '2017-01-01T00:00:00.000Z', active: true }
})

Authorizations

Authenticationheaderrequired
string

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

handlerequired
string

The document's _id or slug.

Body

application/json
endsrequired
string

Response

200 - application/json
_id
string
email
string
license
object
name
string
oAuthIdentities
object[]
role
string

Usually either 'teacher' or 'student'

slug
string
stats
object
subscription
object