cURL
curl --request PUT \ --url https://codecombat.com/api/users/{handle}/license \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --data '{ "ends": "<string>" }'
{ "_id": "<string>", "email": "<string>", "name": "<string>", "slug": "<string>", "role": "<string>", "stats": { "gamesCompleted": 123, "concepts": {}, "playTime": 123 }, "oAuthIdentities": [ { "provider": "<string>", "id": "<string>" } ], "subscription": { "ends": "<string>", "active": true }, "license": { "ends": "<string>", "active": true } }
Grants a user access to the Classroom version up to a certain time. Sets their role to student.
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 } })
Show child attributes