Learn about and experiment with the DPA API
The DPA API is documented in the Swagger interface. Use this interactive interface to explore the available API endpoints and try out API calls.
You can use scripts to call the API outside of the Swagger interface. See examples of Python and PowerShell scripts that call the DPA API.
Access the DPA API documentation and get authorization to make API calls
You can access the URL and review the DPA API documentation without being authorized to make API calls. However, an access token is required to make API calls. Complete the following steps to access the API documentation and authenticate with an access token.
- Create a new refresh token and copy it to the clipboard, or copy an existing refresh token that your organization has stored in a secure location.
-
From the DPA menu in the upper-right corner, click Options.
-
Under Support > Utilities, click Management API Documentation.
The Swagger interface opens.
- Use the refresh token to obtain an access token:
Click Access Token to expand it.
- Click Post to expand that section.
- Click the Try it out button.
Paste the refresh token value you copied in step 1 into the refresh_token box.
Click Execute.
Copy the access token within the quotation marks in the Response body. (Do not include the quotation marks.)
-
Authenticate with the access token:
-
In the upper-right corner, click Authorize.
-
In the Available authorizations dialog, type
bearer
followed by a space, and then paste the access token. -
Click Authorize.
If the authorization is successful, the following dialog is displayed.
-
Click Close.
You can now use the Swagger interface to learn about and execute the available API commands.
-
View the DPA API documentation
The Management API spec provides detailed information about each API endpoint. Endpoints are grouped by function.
-
Click any group to display the endpoints within it.
-
Click the endpoint to display its parameters and responses.
Complex parameters and responses include an Example Value | Model section. The example value is shown by default.
-
Click Model to display additional information, including the valid values for enumerations.
Make an API call from the Swagger interface
The following example shows how to make a call to get the current license allocation for a monitored database instance.
When you make an API call through the Swagger interface, the call affects your DPA server in the same way as it would if it were issued through a command or script.
- If you do not know the database ID, complete the following steps to get it:
- Click Database Monitor to display the endpoints.
Click GET/databases/monitor-information to expand it.
- Click Try it out, and then click Execute.
Scroll through the Response body, find the database name, and make a note of the associated ID.
- Click License Allocation to display the endpoints.
-
Click the GET/databases/{databaseId}/licenses endpoint to expand it.
-
Click Try it out.
The interface displays a field for the parameter value and an Execute button.
-
Enter the database ID and click Execute.
The Response body section shows the response from the DPA server, and the Curl section shows the Curl command (including the access token) that could be run to make this API call.