API RESTful Integration

API RESTful Integration

Get API Credentials

Notes
You must have an Organization Administration account in LDI portal to generate API credentials.
Before you use LDI APIs, you must generate API credentials in the LDI account.
  1. Click Organization Settings in the Users drop-down list. 
  2. Click API Credentials. You see API Credentials pane. 
    1. Note: If there are no API credentials, you must generate them.
  3. Click Generate.
    1. Note: A Client ID and Secret key are generated. You can copy them to the clipboard.
    2. Keep the API credentials in a secure place and regenerate them over the time in accordance with business policies of your organization.
    3. If you want to change the existing API credentials, you must generate a new one.
  4. Click Regenerate
  5. In the Regenerate Secret window, click Regenerate.
  6. A new Client ID and Secret key is generated.
The Client ID and Secret key do not expire until you regenerate a fresh pair.
After you have generated API credentials, you can use the following URLs to access different API endpoints.
Type the URL : https://auth.naea1.uds.lenovo.com or https://auth.euwe1.uds.lenovo.com, depending upon the organization region the devices are located.
Notes
After you generate a new pair of Client ID and Secret key, the older pair gets invalid.
Get a Bearer token. 
Info
The bearer token is a type of an access token that uses Auth 2.0 and expires within 30 minutes. You use the bearer token to get a new Access token. To get an access token you send the Authentication server this bearer token along with your client id. This way the server knows that the application using the bearer token is the same application that the bearer token was created for.
Generate API bearer token using External API.
The URL -  Base URL + /api/v1/auth/<organization_name>/token
Notes
The Base URL depends on your region whether NA or EU.
Body should be x-ww-form-urlencoded and should contain:
  1. grant_type: client_credentials
  2. client_secret: secret (from api credentials page)
  3. client_id: id (from api credentials page)
Notes
Generate a new bearer token when it expires after 30 minutes.

Learn API Operations

Swagger specification archive contains a folder with an index.html file and some other JavaScript files.
  1. Download Swagger Specification zip file from the support site which provides you details about each API.
  2. Extract the files in the folder. 
  3. Double-click to open the index.html. You see the LDI  APIs home page in Swagger.
  4. Generate a bearer token.

Try APIs

  1. Select an API method in Swagger. 
  2. Use the bearer token in the call. 
  3. Click Try it out. 

Examples of API Methods

Authentication - API token session

Lenovo SDK snapshot


HTTP Response


Negative API Sample

Groovy ACME Test


HTTP Request

HTTP Response


    • Related Articles

    • ServiceNow Integration

      Prerequisites Establish parity between LDI and ServiceNow Platforms. A physical device like laptop, desktop, server, etc. is referred to as a Device in LDI application and as an Asset in the ServiceNow application. You must synchronize devices in LDI ...
    • Organization Settings

      Before you use LDI APIs, you must generate API credentials in the LDI account. Click Organization Settings in the Organization Admin window. Click API Credentials in the Organization Settings window. The API Credentials pane appears. If there are no ...
    • Azure Active Directory, Okta and LenovoID

      Azure Active Directory Azure Active Directory (AAD) registration is supported for several use cases, such as integration with InTune for fleet deployment. Okta LDI supports Okta Single Sign On. Lenovo ID Lenovo ID is the secure and trusted mechanism ...