Introduction
You can use the Autify Nexus API to do things like run tests programmatically or even integrate Autify Nexus into your CI/CD pipeline with custom scripts. This guide provides basic information that you will need when making API calls for Autify Nexus.
Prerequisites
You are an admin in your Autify Nexus organization
You have access to and are comfortable using a Unix-like command line interface such as Terminal on macOS or WSL on Windows
Make sure you have the following information:
Autify Nexus server URL (the URL you use to sign in to Autify Nexus)
Create an API client in Autify Nexus
In Autify Nexus:
Click Settings (
)
Navigate to the “Your account” section
Click Manage API clients to open the “Manage API clients” page
Click Create API client at the top-right of the page
In the dialog window that opens, enter a unique value (case-insensitive) for the Client ID and click Create
An optional name and description can be provided to help you better identify or organize your clients.
Generate a temporary access token
You need an access token to call the Autify Nexus API. This token is temporary, and will need to be regenerated once it expires. The following steps show you how to generate an access token using a terminal command.
Get the command
In Autify Nexus, on the “Manage API clients” page:
Click the
icon to see the API credentials for your API client
The client secret is hidden by default — click the
icon to reveal it
After revealing the client secret, copy the
curl
command at the bottom of the dialog window
Example command
curl --location 'https://{NEXUS_SERVER}/auth/realms/{ORG_ID}/protocol/openid-connect/token' \
--data-urlencode 'client_id={CLIENT_ID}' \
--data-urlencode 'client_secret={CLIENT_SECRET}' \
--data-urlencode 'grant_type=client_credentials'
Generate the access token
In a new terminal window, run the curl
command you copied from Autify Nexus. If successful, you will receive a response with information about an access token.
Example response
{
"access_token": "very_long_string",
"expires_in": 1800,
"refresh_expires_in": 0,
"token_type": "Bearer",
"not-before-policy": 0,
"scope": "profile email"
}
Save the value of the access_token
field in the response — without the quotations. You will need it when making API calls. Be aware that this access token is temporary, and will need to be regenerated after it expires.
Make an API call
API calls are made via the nexus
endpoint on your Autify Nexus server. For example:
Autify Nexus server |
|
API endpoint |
|
To make an API call, you will need to pass the access_token
that you previously generated as a Bearer
token for authorization.
Example call to api/workspaces
API_ENDPOINT=""
ACCESS_TOKEN=""
curl -X GET "${API_ENDPOINT}/api/workspaces" \
-H "Authorization: Bearer ${ACCESS_TOKEN}"
Output
>> [{"id":"4cbcd34e-60b6-4a43-a78d-df7bf84d8849"}]
Next steps
Explore our full API documentation for more information on what you can do with the Autify Nexus API.