Postman is an API platform for building and using APIs. This article will help you in understanding how to configure Aura API endpoints in Postman. Remember to save you changes in Postman as you go.
Prerequisites
- User must have the aura-api role. Please raise a support ticket with us if you want to get this role associated to your user.
- API credentials requested via the account screen in the Aura Admin console
- Postman
- Docs for reference: https://neo4j.com/docs/aura/platform/api/specification/
Authorization
You can set the authorization at parent level so that every child request can inherit from the parent.
Parent Authorization Configuration
- Launch Postman, from the Home screen click on Workspaces and select either the default value (My Workspace) or create a new one.
- Click on the "+" icon located at the top left to create a new collection. Let's name it "auraapitesting".
- The next screen will appear as follows:
- Navigate to the "Variables" tab and add the necessary variables:
- Switch to the "Authorization" tab and configure the authorization at the parent level. This allows child requests to inherit the authorization from the parent, eliminating the need to repeatedly pass the token in each child request. Select OAuth 2.0 as the authorization type and set Add authentication data to the "Request Headers".
- Scroll down to configure a new token by filling in the required details in 'Configure New Token' section:
- In the "Current Token" section, select the token you just created with the name "acs_token".
- Click on "Get New Token" and below dialog box will appear.
- The Parent authorization step has now been completed. You can now inherit this authorization in child requests.
Child Authorization Configuration
- To begin, click on the three dots located next to the collection name and choose "Add request".
- Once the request is added, navigate to the authorization tab and select the "Inherit auth from parent" option.
- By doing this, the token will be automatically inherited from the parent request, eliminating the need for manual passing of the token repeatedly.
Example:
Pause an Aura Instance:
This will Initiate the pause process of an Aura instance It is important to note that pausing an instance is an asynchronous operation. You can periodically poll the current status of this operation by retrieving the instance details using the GET /instances/{instanceId} endpoint.
The amount of time it takes to pause an instance depends on the quantity of data stored in the instance, with larger quantities of data taking longer. The exact duration of the pause is dependent on the size of the data store.
If another operation is already being performed on the instance you are trying to pause, a 409 Conflict HTTP response code will be returned indicating that the pause operation cannot be performed.
As pause is an asynchronous operation, the endpoint returns a 202 Accepted HTTP response code.
API Endpoint: {{base_url}}/{{api_version}}/instances/:instance_id/pause
HTTP Request Method: POST
Please ensure that you include the necessary Auth details as mentioned in Child Authorization Configuration .In this request, we are passing instance id as a parameter as shown below:
Upon successful acceptance of the Pause operation, an HTTP response code of 202 Accepted will be received. You can verify the pausing state of your database by logging into the console.
In case of any issues, please raise support ticket with us, including details of the issue, like screenshots, error messages.
Comments
0 comments
Please sign in to leave a comment.