PostmanOpenAPIContact usSign up
  • Overview
    • Introduction
  • API Reference
    • POSTAdd Oauth2 Identity
LogoLogo
PostmanOpenAPIContact usSign up
API ReferenceUsers

PUT
https://codecombat.com/api/users/:handle/subscription
PUT
/api/users/:handle/subscription
1import requests
2
3url = "https://codecombat.com/api/users/%3Ahandle/subscription"
4
5payload = { "ends": "string" }
6headers = {
7 "Authorization": "Basic <username>:<password>",
8 "Content-Type": "application/json"
9}
10
11response = requests.put(url, json=payload, headers=headers)
12
13print(response.json())
Try it
200Updated
1{
2 "_id": "string",
3 "email": "string",
4 "name": "string",
5 "slug": "string",
6 "role": "string",
7 "stats": {
8 "gamesCompleted": 1,
9 "concepts": {
10 "string": 1
11 },
12 "playTime": 1
13 },
14 "oAuthIdentities": [
15 {
16 "provider": "string",
17 "id": "string"
18 }
19 ],
20 "subscription": {
21 "ends": "string",
22 "active": true
23 },
24 "license": {
25 "ends": "string",
26 "active": true
27 }
28}
Was this page helpful?
Previous

Shorten User Subscription

Next
Built with
Grants a user premium access to the "Home" version up to a certain time.
Put Subscription

Authentication

AuthorizationBasic
Basic authentication of the form `Basic <username:password>`.

Path Parameters

handlestringRequired
The document's `_id` or `slug`.

Request

This endpoint expects an object.
endsstringRequired

Response

This endpoint returns an object.
_idstring or null
emailstring or null
namestring or null
slugstring or null
rolestring or null
Usually either 'teacher' or 'student'
statsobject or null
oAuthIdentitieslist of objects or null
subscriptionobject or null
licenseobject or null

The document’s _id or slug.

Basic authentication of the form Basic <username:password>.