Skip to main content

POST /authCodes

Use this method to add one or more license-authorization codes in Lenovo XClarity Administrator by retrieving authorization-code data from the Features on Demand web portal and, if the authorization code has already been redeemed, retrieve its license-activation keys.

Note
This REST API requires Lenovo XClarity Administrator v3.5.0 or later.

Authentication

Authentication with username and password is required.

Request URL

POST https://{management_server_IP}/authCodes

Query parameters

None

Request body

  • Add a single authorization code
    AttributesRequired / OptionalTypeDescription
    authCodeRequiredStringLicense-authorization code ID
    lenovoCustomerNumberRequired if authCode is not specifiedStringLenovo customer number

    You can specify either authCode or lenovoCustomerNumber, but not both.

    retrieveKeysOptionalBooleanIndicates whether to retrieve license-activation keys. This can be one of the following values.
    • true. Retrieve license-activation keys.
    • false. (default) Do not retrieve license-activation keys.
    The following example adds an authorization code to XClarity Administrator but does not retrieve the license-activation keys for that code.
    {
    "authCode": "YYA7BQ2V37V11O0AID2K4"
    }
    The following example adds an authorization code to XClarity Administrator and retrieves license-activation keys for that code.
    {
    "authCode": "YYA7BQ2V37V11O0AID2K4"
    "retrieveKeys": true
    }
    The following example retrieves license-activation keys for that all authorization codes associated with the specified Lenovo customer number.
    {
    "lenovoCustomerNumber": "1234567890",
    "retrieveKeys": true
    }
  • Add multiple authorization codes

    Use the multipart/form-data content type to import a CSV file that contains one or more authorization codes, separated by a comma (for example, WWGDISQHE24UQK05MVM1P9,WWMEHFI7SNL7K9L59T6OBT,WWTRPECTK9OFNHR8RJUPVT). For more information about the multipart/form-data media type, see Returning Values from Forms: multipart/form-data webpage.

    The following example imports a CVS file that contains the authorization codes.
    Request Header
    Content-Type: multipart/form-data; boundary=AaB03x
    Request body
    --AaB03x
    Content-Disposition: form-data; name="fileUpload"; filename="auth_codes.csv"
    Content-Type: application/octet-stream
    --AaB03x--

  • Retrieve license-activation keys

    AttributesRequired / OptionalTypeDescription
    authCodeRequiredObjectInformation about the authorization code for which you want to retrieve license-activation keys
     authCodeRequiredStringLicense-authorization code ID

    If you specify a Lenovo customer number, specify an empty string for the authorization code.

     lenovoCustomerNumberOptionalStringLenovo customer number

    If you specify an authorization code, specify an empty string for the Lenovo customer number.

     retrieveKeysOptionalBooleanIndicates whether to retrieve license-activation keys. This value is always true.
    The following example fetches the redeemed license-activation keys for a specific authorization code.
    {
    "authCode": {
    "authCode": "YYA7BQ2V37V11O0AID2K4",
    "retrieveKeys": true
    }
    }
    The following example fetches the redeemed license-activation keys for all authorization codes that are associated with a specific Lenovo customer number.
    {
    "authCode": {
    "authCode": "",
    "lenovoCustomerNumber": "1234567890",
    "retrieveKeys": true
    }
    }

Response codes

CodeDescriptionComments
200OKThe request completed successfully.
400Bad RequestA query parameter or request attribute is missing or not valid, or the operation is not supported. A descriptive error message is returned in the response body.
403ForbiddenThe orchestrator server was prevented from fulfilling the request. A descriptive error message is returned in the response body. Ensure that you have privileges to perform the request.
409ConflictThere is a conflict with the current state of the resource. A descriptive error message is returned in the response body.
500Internal Server ErrorAn internal error occurred. A descriptive error message is returned in the response body.

Response body

AttributesTypeDescription
authCodesArray of objectsInformation about each license-authorization code
 authCodeStringLicense-authorization code ID
 errorMsgStringMessage description
 featureCodeStringLicense feature code
 featureDescriptionStringLicense feature description
 keysRedeemedIntegerNumber of redeemed license-activation keys
 keysRemainingIntegerNumber of available (not redeemed) license-activation keys
 lenovoCustomerNumberStringLenovo customer number
 licenseKeysArray of objectsInformation about each license-activation key
  customerNumberStringLenovo customer number associated with the license-activation key
  licenseKeyIdStringLicense-activation key ID
  quantityIntegerNumber of redeemed licensees
  stateStringLicense-activation key state. This can be one of the following values.
  • installed. The license-activation key is installed in XClarity Administrator.
  • not installed. The license-activation key is not installed.
 partNumberStringLicense part number
 purchaseOrderStringLicense purchase-order number
 salesOrderStringLicense sales-order number
 startDateStringDate when the authorization code was created and the license validation period starts

This date is specified using ISO-8601 format (for example, 2019-05-02). For information about ISO-8601 format, see the W3C Date and Time Formats webpage.

customerInfoObjectInformation about the customer that is associated with the license-authorization codes
 companyNameInEnglishStringCustomer company name in English
 companyNameInLocalLanguageStringCustomer company name in local language
 contactPhoneNumberStringCustomer phone number
 contactEmailAddressStringCustomer email address
 customerAddressStringCustomer physical address
 customerCityStringCustomer city
 customerRegionStateOrProvinceStringCustomer state or region
 customerPostalCodeStringCustomer postal code
 countryStringCustomer country code

For a complete list of country codes, use GET /licenseCountries.

 firstNameStringCustomer given name
 lastNameStringCustomer family name
 preferredLanguageStringLanguage code of the preferred language

For a complete list of language codes, use GET /licenseCountries.

The following example is returned if the request is successful when a CSV file is used to create multiple license authorization codes.
{
"authCodes": [{
"authCode": "YYA7BQ2V37V11O0AID2K4",
"errorMsg": "",
"featureCode": "1341 contact",
"featureDescription": "Lenovo XClarity Pro, Per Managed Endpoint w/5 Yr SW S&S",
"keysRedeemed": 0,
"keysRemaining ": 50,
"lenovoCustomerNumber": "1234567890",
"licenseKeys": [],
"partNumber": "5641PX5",
"purchaseOrder": "00000000",
"salesOrder": "999999999",
"startDate": "2020-06-02",
},
{
"authCode": "YYA7BQ2V37V11O0AID2K5",
"errorMsg": "",
"featureCode": "1341 contact",
"featureDescription": "Lenovo XClarity Pro, Per Managed Endpoint w/5 Yr SW S&S",
"keysRedeemed": 0,
"keysRemaining ": 50,
"lenovoCustomerNumber": "1234567890",
"licenseKeys": [],
"partNumber": "5641PX5",
"purchaseOrder": "00000000",
"salesOrder": "999999999",
"startDate": "2020-06-02"
}],
"customerInfo": {
"companyNameInEnglish": "Some Company",
"companyNameInLocalLanguage": " Some Company ",
"contactEmailAddress": "jane.doe@somecompany.com",
"contactPhoneNumber": "9995551212",
"customerAddress": "10 Main Street",
"customerCity": "Rockville",
"customerRegionStateOrProvince": "NY",
"customerPostalCode": "12345",
"country": "US",
"firstName": "Jane",
"lastName": "Doe",
"preferredLanguage": "EN"
}
}
The following example is returned if the request is successful when the authCode attribute in the JSON request body is used to create a single license authorization code and when license keys are fetched (keyState = retrieve).
{
"authCodes": [{
"authCode": "YYA7BQ2V37V11O0AID2K5",
"errorMsg": "",
"featureCode": "1341 contact",
"featureDescription": "Lenovo XClarity Pro, Per Managed Endpoint w/5 Yr SW S&S",
"keysRedeemed": 0,
"keysRemaining ": 50,
"lenovoCustomerNumber": "1234567890",
"licenseKeys": [{
"licenseKeyFile": "00001",
"customerNumber": "1234567890",
"licenseKeyId": "00001",
"quantity": 20,
"state": "installed"
},
{
"customerNumber": "1234567890",
"licenseKeyId": "00003",
"quantity": 30,
"state": "installed"
},
...],
"partNumber": "5641PX5",
"purchaseOrder": "00000000",
"salesOrder": "999999999",
"startDate": "2020-06-02"
}],
"customerInfo": {
"companyNameInEnglish": "Some Company",
"companyNameInLocalLanguage": " Some Company ",
"contactEmailAddress": "jane.doe@somecompany.com",
"contactPhoneNumber": "9995551212",
"customerAddress": "10 Main Street",
"customerCity": "Rockville",
"customerRegionStateOrProvince": "NY",
"customerPostalCode": "12345",
"country": "US",
"firstName": "Jane",
"lastName": "Doe",
"preferredLanguage": "EN"
}
}