API Settings

The AD360 REST APIs facilitate sharing of data between AD360 and any third-party application or web service; they allow you to manage the various settings available in AD360, such as domain settings, proxy server settings, and email server settings. These APIs can be leveraged from any application capable of making HTTP requests.

Available APIs

The following list contains AD360 APIs currently available, as well as their functions:

API Function
Get Domain Settings  Read the details of the domains configured in AD360.
Update Domain Credential Add/modify the domain credential configured in AD360.
Get Proxy Settings  Read the proxy server settings configured in AD360.
Update Proxy Settings Add/modify the proxy server settings configured in AD360.
Get Mail Server Settings Read the mail server settings configured in AD360.
Update Mail Server Settings Add/modify the mail server settings configured in AD360.

Note: Only JSON requests (Content-Type: application/x-www-form-urlencoded) and responses (Content-Type: application/json) are supported.

How do I access AD360's APIs?

To access AD360's APIs, you first need to create an AuthToken. Follow the steps below:

  1. Log in to AD360 as an admin.
  2. Go to Admin → General Settings → API Settings.
  3. ad360-api-settings

  4. Click Create New AuthToken.
  5. Select the scopes that you want to access by clicking on the + symbol.

    What is scope?
    Scope defines what APIs can be accessed using an AuthToken. One or a group of APIs can be part of a scope.

  6. Next, choose an expiration date for the AuthToken.
  7. Click Create.
  8. create-auth-token

  9. Your AuthToken will be created.

    Note: Copy this AuthToken and keep it safe for further use. If lost, it cannot be retrieved and must be regenerated.

API usage

To access an AD360 API, use the URL format below:

<scheme:port[/context]>/RestAPI/*.*[?query][#fragment]

Example: http://ad360-server:8082/RestAPI/DomainSettings/getDomains

Authorization: Bearer <authtoken>

Managing the AuthTokens

You can find all the AuthTokens you’ve created under the API Settings page in AD360. From here, you can see various details of the AuthTokens, such as their expiration date, scope, created date, and last accessed time. You can also revoke an AuthToken to disable it completely. Follow the steps below to manage AuthTokens:

  1. Log in to AD360 as an admin.
  2. Go to Admin → General Settings → API Settings. You’ll see a table containing all the AuthTokens you’ve created.
  3. To filter the AuthTokens: From the Showing drop down, you can select whether you want to view all the AuthTokens or only the AuthTokens that are active, expired, or revoked.
  4. To view the scopes of an AuthToken: Click under the Scope column to view all the scopes that an AuthToken provides access to.
  5. To audit AuthToken access: Hover the mouse over the values in the Last Accessed Time column. An audit icon will appear. Click it to view a detailed audit trail of who accessed the AuthToken.
  6. To revoke an AuthToken: Hover the mouse in the open space next to Last Accessed Time column. A Revoke link will appear. Click it to revoke the AuthToken.
  7. Note:  Once an AuthToken is revoked, the APIs that depend on it will no longer work.

Get Domain Settings API

This API allows you to get details of the domains configured in AD360.

Sample request

http://ad360-dc1:8082/RestAPI/DomainSettings/getDomains

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

Sample response

[{"DEFAULT_NAMING_CONTEXT":"DC=ad360,DC=local","IS_DEFAULT_DOMAIN":"true","DC_LIST":["win2k12master.ad360.local","EST-ADC.ad360.local"],"DOMAIN_FLAT_NAME":"AD360","DOMAIN_NAME":"ad360.local","DOMAIN_DNS_NAME":"ad360.local","DOMAIN_FUNCTIONAL_LEVEL":"Windows Server 2008"}]

Update Domain Settings API

This API allows you to update the domain settings in AD360.

Sample request

http://ad360-dc1:8082/RestAPI/DomainSettings/updateDomainCredential

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

DOMAINS=[{"DOMAIN_NAME":"ad360.local","USER_NAME":"admin","USER_PASSWORD":"Test123"}]

Sample response

{"STATUS":"SUCCESS","DOMAINS":{"ad360.local":"{\"DOMAIN_STATUS\":\"SUCCESS\"}"}}

Get Proxy Settings API

This API allows you to get the details of the proxy server configured in AD360.

Sample request

http://ad360-dc1:8082/RestAPI/ProxySettings/getSettings

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

Sample response

{"ENABLE_PROXY":"true","SERVER_NAME":"ad360-dc1","PORT":"5005","USER_NAME":"admin"}

Update Proxy Settings API

This API allows you to update the proxy settings in AD360.

Sample request

http://ad360-dc1:8082/RestAPI/ProxySettings/updateSettings

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

PROXY_SETTINGS={"ENABLE_PROXY":"true","SERVER_NAME":"ad360-dc1","PORT":"5005","USER_NAME":"admin","PASSWORD":"Test123"}

Sample response

{"STATUS": "SUCCESS"}

Get Mail Settings API

This API allows you to get the details of the mail server configured in AD360.

Sample request

http://ad360-dc1:8082/RestAPI/MailSettings/getSettings

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

Sample response

{"PORT":"25","FROM_MAIL_ID":"no-reply@ad360.local","SERVER_NAME":"smtp","USER_NAME":"admin","ADMIN_MAIL_ID":"admin@ad360.local,super-admin@ad360.local"}

Update Mail Settings API

This API allows you to update the mail server settings in AD360.

Sample requesttbox

http://ad360-dc1:8082/RestAPI/MailSettings/updateSettings

Authorization: Bearer ztfhotq5ytctmgy4zi00nzk2lwjiodkmtwvlymvjyja3yjm5

MAIL_SETTINGS={"PORT":"25","FROM_MAIL_ID":"no-reply@ad360.local","SERVER_NAME":"smtp","USER_NAME":"admin","ADMIN_MAIL_ID":"admin@ad360.local","PASSWORD":"Test123"}

Sample response

{"STATUS": "SUCCESS"}

Common error response codes

AT001 - Invalid or missing AuthToken. Check whether the AuthToken is not revoked or expired.
AT002 - The given AuthToken doesn't have necessary permission to access the requested API.
AT003 - The requested API doesn't support this HTTP Method.
AT004 - Access denied. User role has changed and the user no longer has permission to access this API.
AT005 - Access denied. You don't have permission to access this API. Please contact your administrator.
CE001 - Invalid or missing mandatory parameters.
CE002 - Something went wrong.
CE003 - Invalid username or password.

Don't see what you're looking for?

  •  

    Visit our community

    Post your questions in the forum.

     
  •  

    Request additional resources

    Send us your requirements.

     
  •  

    Need implementation assistance?

    Try onboarding

     

Copyright © 2023, ZOHO Corp. All Rights Reserved.