REST API Reference > Platform REST API version 3 resources > Licenses
  

Licenses

Use the license resource to get license information about organizations and assign licenses to sub-organizations. In order to assign licenses to a sub-organization, you must log in to the parent organization as an administrator.
You can use the license resource to send the following requests:

Getting license details

Use a GET request to obtain an organization's editions, custom licenses, and custom limits.

GET request

To request license information for an organization or sub-organization, use the following URI:
/public/core/v3/license/org/<orgId>

GET response

Returns requested license information if successful or an error object if errors occur.
If successful, returns the following license information for the specified organization ID:
Field
Type
Description
customLicenses
List
Information about the organization's custom licenses.
licenseDef
String
Included in the customLicenses object.
The unique identifier for the custom license.
expirationDate
String
Included in the customLicenses object.
Time at which the license expires.
licenseType
Included in the custom license object.
Type of license.
Includes the following values:
  • - TRIAL
  • - SUBSCRIPTION
  • - FREE
  • - NONE
assignedEditions
List
Information about the organization's editions in the edition object.
edition
String
Included in the edition object.
Unique identifier for the limit.
expirationDate
String
Included in the edition object.
Expiration date for the edition.
customLimits
List
Information about the organization's custom limits.
limitDefinition
String
Included in the customLimit object.
Unique identifier for the limit.
value
Integer
Included in the customLimit object.
Maximum uses of the limit.
Use -1 to indicate there is no maximum for the limit.

GET example

The following example shows a request for an organization's license information:
GET <baseApiUrl>/public/core/v3/license/org/1ax3wad2FEsz35asd2892s
Content-Type: application/json
Accept: application/json
INFA-SESSION-ID: <sessionId>
The response includes license information for the organization as shown in the following example:
{
"id": "1ax3wad2FEsz35asd2892s",
"parentOrg": null,
"customLicenses": [
{
"licenseType": "SUBSCRIPTION",
"expirationDate": "2017-11-05T18:01:24Z",
"licenseDef": "a5Xjp3VF3sjcyZUDa6UaWh"
}
],
"assignedEditions": [
{
"expirationDate": "2017-11-05T18:01:24Z",
"edition": "4sdvnCrYEjfcKjTvAoigEF"
},
{
"expirationDate": "2018-10-06T18:00:08Z",
"edition": "5SPzPwEFvBEds8LzVwXX4K"
}
],
"customLimits": [
{
"value": -1,
"limitDefinition": "09cX4Tmi1qSfrS997ORMYl"
}
]
}

Updating a sub-organization's licenses

Use a PUT request to update a sub-organization's license information.

PUT request

In order to update licenses for a sub-organization, you must log in to the parent organization as an administrator.
This request overwrites the sub-organization's licenses with the licenses in the request. To make changes to a sub-organization's licenses, first request license information for the sub-organization, make your modifications in the object, and then use it as the request body.
To update license information for a sub-organization, use the following URI:
/public/core/v3/license/org/<orgId>

PUT response

Returns a success code if successful or an error object if errors occur.

PUT example

To change a sub-organization's licenses, you might use the following request:
PUT <baseApiUrl>/public/core/v3/license/org/<orgId>
Accept:application/json
INFA-SESSION-ID: <sessionId>

{
"customLicenses": [
{
"licenseType": "SUBSCRIPTION",
"expirationDate": "2017-11-05T18:01:24Z",
"licenseDef": "a5Xjp3VF3sjcyZUDa6UaWh"
}
],
"assignedEditions": [
{
"expirationDate": "2017-11-05T18:01:24Z",
"edition": "4sdvnCrYEjfcKjTvAoigEF"
},
{
"expirationDate": "2018-10-06T18:00:08Z",
"edition": "5SPzPwEFvBEds8LzVwXX4K"
}
],
"customLimits": [
{
"value": -1,
"limitDefinition": "09cX4Tmi1qSfrS997ORMYl"
}
]
}