Connecting to the TS7785 API

The TS7785 REST model Application Programming Interface (API) consists of commands that are used to read system resources. The RESTful API uses HTTPS (Hypertext Transfer Protocol Secure) to provide an encrypted channel between the client and the server. You must create a token for authentication.

You must create a token for authentication.

The URL structure for an operation is https://ip_address/api/command

where,
  • ip_address is the IP address of the TS7785 storage system.
  • api is the API application name.
  • command is the resource that is targeted for the operation.

Creating a token using Curl

You must create a token using POST method before other RESTful API operations can be initiated. It fulfills all security requirements of the RESTful API.

Note: The created token is used in the URL parameter for all subsequent operations that are initiated with the RESTful API.

The following example shows how to use CURL for authentication.

curl -k --request POST 'https://ip_address/api/token' --data-raw '{"username":"enter_username","password":"enter_password"}'

This yields an authentication token that you use for all other commands. The response is formatted for clarity.

Header: 

“X-Auth-Token: eyJ0eXAiOi…“ 

 

“metadata": { 
  "responseSent": "2025-06-06T13:31:08", 
  "request": "POST https://abc123.tuc.stglabs.ibm.com/api/token", 
  "resources": 1, 
  "version": “1.00”, 
  "requestReceived": "2025-06-06T13:31:08" 
}, 
“data”: [ 

  { 

    “username“: “XXXXX“, 

    “policyName“: “Local“, 

    “policyType“: “Local“, 

    “expiresAt“: “2025-06-13T19:41:26“, 

    “issuedAt“: “2025-06-13T18:41:26“ 

  } 

Renewing a token using Curl

You can also use POST method to renew a token. The renewed token builds upon a non-expired, previously retrieved token. NO username or password is required (No parameter is needed).

curl -k --request POST -H "Authorization: Bearer eyJraWQiOiJwM0p..." 'https://ip_address/api/token'
Note: The provided curl command syntax may not work under Windows environment, it depends on the application to run the curl command. You may need to adjust the command syntax if it does not work.

Content type

TS7785 RESTful API supports JSON responses only.

  • Supported media type: application/json