Azure Integration API.
Created Mar 27, 2024 at 07:12 PM

Overview

Resources

Sync: Enable/Disable All Azure Accounts

Enable/Disable All Azure Accounts.

PUT https://{device}/api/npm.azure_config/1.0/sync/status
Authorization

This request requires authorization.

Request Body

Provide a request body with the following structure:

  • JSON
{
  "status": string
}

Example:
{
  "status": "ENABLED"
}
Property Name Type Description Notes
SyncStatus <object> Object containing information to enable or disable the accounts.
SyncStatus.status <string> Value to enable or disable the accounts. Values: ENABLED, DISABLED
Response Body

On success, the server does not provide any body in the responses.

Sync: Sync All Azure Accounts

Sync All Azure Accounts.

POST https://{device}/api/npm.azure_config/1.0/sync
Authorization

This request requires authorization.

Request Body

Do not provide a request body.

Response Body

On success, the server does not provide any body in the responses.

Auth_Codes: Delete Azure Accounts

Delete Azure Accounts.

DELETE https://{device}/api/npm.azure_config/1.0/auth_codes
Authorization

This request requires authorization.

Request Body

Provide a request body with the following structure:

  • JSON
[
  {
    "acc_id": string
  }
]

Example:
[
  {
    "acc_id": "acc_1"
  }, 
  {
    "acc_id": "acc_2"
  }
]
Property Name Type Description Notes
Accids <array of <object>> List of Accid Objects.
Accids[Accid] <object> Object representing and account name/ID. Optional
Accids[Accid].acc_id <string> Account name/ID.
Response Body

On success, the server does not provide any body in the responses.

Auth_Codes: Get the authorization information of the Azure Accounts

Delete Azure Accounts.

GET https://{device}/api/npm.azure_config/1.0/auth_codes
Authorization

This request requires authorization.

Response Body

On success, the server returns a response body with the following structure:

  • JSON
[
  {
    "tenant_id": string,
    "subscription_id": string,
    "acc_id": string,
    "app_id": string
  }
]

Example:
[
  {
    "tenant_id": "tenant_1", 
    "subscription_id": "subscr_1", 
    "acc_id": "acc_1", 
    "app_id": "app_1"
  }, 
  {
    "tenant_id": "tenant_2", 
    "subscription_id": "subscr_2", 
    "acc_id": "acc_2", 
    "app_id": "app_2"
  }
]
Property Name Type Description Notes
AuthcodesAzure <array of <object>> List of Auth code Objects.
AuthcodesAzure[AuthcodeAzure] <object> Object representing an account name/ID and it's authorization information. Optional
AuthcodesAzure[AuthcodeAzure].tenant_id <string> Account tenant id.
AuthcodesAzure[AuthcodeAzure].
subscription_id
<string> Account subscription id.
AuthcodesAzure[AuthcodeAzure].acc_id <string> Acount name/ID.
AuthcodesAzure[AuthcodeAzure].app_id <string> Account app id.

Auth_Codes: Create/Update Azure Accounts

Delete Azure Accounts.

PUT https://{device}/api/npm.azure_config/1.0/auth_codes
Authorization

This request requires authorization.

Request Body

Provide a request body with the following structure:

  • JSON
[
  {
    "tenant_id": string,
    "subscription_id": string,
    "acc_id": string,
    "app_id": string,
    "app_passwd": string
  }
]

Example:
[
  {
    "app_passwd": "app_1_passwd", 
    "tenant_id": "tenant_1", 
    "subscription_id": "subscr_1", 
    "acc_id": "acc_1", 
    "app_id": "app_1"
  }, 
  {
    "app_passwd": "app_2_passwd", 
    "tenant_id": "tenant_2", 
    "subscription_id": "subscr_2", 
    "acc_id": "acc_2", 
    "app_id": "app_2"
  }
]
Property Name Type Description Notes
AuthcodesAzureupd <array of <object>> List of Auth code Objects.
AuthcodesAzureupd[AuthcodeAzureupd] <object> Object representing an account name/ID, it's authorization information. Optional
AuthcodesAzureupd[AuthcodeAzureupd].
tenant_id
<string> Account tenant id.
AuthcodesAzureupd[AuthcodeAzureupd].
subscription_id
<string> Account subscription id.
AuthcodesAzureupd[AuthcodeAzureupd].
acc_id
<string> Acount name/ID.
AuthcodesAzureupd[AuthcodeAzureupd].
app_id
<string> Account app id.
AuthcodesAzureupd[AuthcodeAzureupd].
app_passwd
<string> Account app password.
Response Body

On success, the server does not provide any body in the responses.

Status: Azure status

Get Azure Status.

GET https://{device}/api/npm.azure_config/1.0/status
Authorization

This request requires authorization.

Response Body

On success, the server returns a response body with the following structure:

  • JSON
{
  "enabled": string,
  "error_text": string,
  "last_sync_ts": number,
  "last_success_ts": number,
  "error_id": number,
  "state": string
}

Example:
{
  "last_sync_ts": 1606234492, 
  "enabled": true, 
  "last_success_ts": 1606234492, 
  "state": "SYNC_SUCCEEDED", 
  "error_id": 0, 
  "error_text": "OK"
}
Property Name Type Description Notes
CloudStatus <object> Object containing synchronization information.
CloudStatus.enabled <string> Flag indicating if synchronization is enabled.
CloudStatus.error_text <string> Error description.
CloudStatus.last_sync_ts <number> Last attempted synchronization time.
CloudStatus.last_success_ts <number> Last successful synchronization time.
CloudStatus.error_id <number> Error ID.
CloudStatus.state <string> Synchronization status. Values: SYNC_INITIALIZING, SYNC_FAILED, SYNC_SUCCEEDED, SYNC_SUCCEEDED_WITH_WARNING, SYNC_DISABLED, SYNC_NA

Error Codes

In the event that an error occurs while processing a request, the server will respond with appropriate HTTP status code and additional information in the response body:

{
     "error_id":   "{error identifier}",
     "error_text": "{error description}",
     "error_info": {error specific data structure, optional}
}

The table below lists the possible errors and the associated HTTP status codes that may returned.

Error ID HTTP Status Comments
INTERNAL_ERROR 500 Internal server error.
AUTH_REQUIRED 401 The requested resource requires authentication.
AUTH_INVALID_CREDENTIALS 401 Invalid username and/or password.
AUTH_INVALID_SESSION 401 Session ID is invalid.
AUTH_EXPIRED_PASSWORD 403 The password must be changed. Access only to password change resources.
AUTH_DISABLED_ACCOUNT 403 Account is either temporarily or permanently disabled.
AUTH_FORBIDDEN 403 User is not authorized to access the requested resource.
AUTH_INVALID_TOKEN 401 OAuth access token is invalid.
AUTH_EXPIRED_TOKEN 401 OAuth access token is expired.
AUTH_INVALID_CODE 401 OAuth access code is invalid.
AUTH_EXPIRED_CODE 401 OAuth access code is expired.
RESOURCE_NOT_FOUND 404 Requested resource was not found.
HTTP_INVALID_METHOD 405 Requested method is not available for this resource.
HTTP_INVALID_HEADER 400 An HTTP header was malformed.
REQUEST_INVALID_INPUT 400 Malformed input structure.
URI_INVALID_PARAMETER 400 URI parameter is not supported or malformed.
URI_MISSING_PARAMETER 400 Missing required parameter.