Regenerate Tenant Access Token

Luma Automation provides Regenerate Tenant Access Token API for super administrators to regenerate access tokens for Luma automation tenants. The API uses the tenant external id as query parameters and regenerates the tenant access token. The tenant access token can now be used to connect to the Luma Automation tenant. This token is sent as the Header to the other tenant workflow APIs such as Get list of workflows, Trigger Workflow, etc.

Once the Tenant Access Token is regenerated, the token should be replaced in the superadmin section or the portal where the correlation of your tenant with automation tenant is managed.

Use the following details to configure the web service:

  1. Use URI: /gateway/api/v1/platform/apiaccesskeys/generate

  2. HTTP Method for the operation: GET

  3. Pass the following as Headers to the Web service:

    1. Capture the Superadmin Access Token from the Superadmin Login API response. This Bearer token is sent as the Header to the API. Header - Authorization: Bearer <Superadmin Access Token>.

    2. Pass Content-Type: application/json as the Header to the Web service.

  4. Use the Tenant External ID as the Query Parameters to the Web Service. For example, you may use tenantExternalId=<Tenant External ID>.
    Sample URI: api/v1/platform/apiaccesskeys/generate?tenantExternalId=5b1a46e1-3113-4fb8-9937-8e3b272323b1

  5. As a response, the web service generates a list of Channel Account ids available in the tenant. Response from the web service is received in the following format:

    { "status": "Success", "statusCode": 0, "statusLine": "Able to generate new access key successfully.", "errors": null, "resultData": { "tenantId": 1000, "tenantExternalId": "9ac452bb-9732-4cf7-9945-219cabc543c0", "tenantAccessToken": "eyJhbGciOiJIUzUxMiJ9.eyJ0ZW5hbnRFeHRlcm5hbElkIjoiOWFjNDUyYmItOTczMi00Y2Y3LTk5NDUtMjE5Y2FiYzU0M2MwIiwiYXV0aFRva2VuIjoiOWFWYTZ0dVNIRFpYRnBWNDg3UjZXdEtFNHpyYmV5MGR5UDcyWk1BT0RwV2w2NE45UjQiLCJpc3MiOiJodHRwOi8vaXRhcy5zZXJ2aWNlYWlkZS5jb20iLCJqdGkiOiJkNWY1OWU0NS03M2Q5LTQ4YmItOWQxZC1iMDI0ZDdjOGE0NDYiLCJpYXQiOjE2NDE4ODYwMTZ9.9ZCvHY0zppLRWQTNy_5pgsq5DylpNP65_Waz3SeCcATeQ6khNkPS9_pjdiYfHwSqGwiDYrw_taQAvJ0qfwKOOw" }, // Tenant Access Token used for tenant workflow APIs "warnings": [], "timestamp": 1641886016844, "reasonPhrase": null, "metaInfo": null }
    1. status represents the execution status of the API call. Success represents that the web service operation was successfully executed.

    2. statusCode represents the status code.

    3. statusLine is the response message received from the web service. The message "Successfully created the Tenant." represents that the tenant is successfully created using the web service.

    4. errors message received in case of an error.

    5. resultData section contains the details in the new tenant created. The following details are received from the web service:

      • tenantId represents the Luma Automation tenant identifier

      • tenantExternalId is the unique identifier used by external applications to communicate with the luma automation Tenant.

      • tenantAccessToken is the regenerated Tenant access token used to authenticate the connection to the tenant. This token is passed as the header to the tenant Workflow APIs.

    6. ‘warnings’ field contains any warning received from web service execution.

    7. ‘timestamp’ represents the time (Epoch time) of web service execution.

    8. ‘reasonPhrase’ represents the error, in case web service execution fails.