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 your 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, please make sure to use the latest available API version. For details please check Aura API Versioning Details.
-
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.
Collection of Aura API Endpoints for Importing into Postman:
You can directly import the collection containing all Aura API Endpoints by copying the below URL and importing it into the Postman Aura APIs Collection
For more information on How to import to Postman, please check the official Postman documentation available here: Importing data into Postman
Once the import is complete, please ensure that you make the required modifications to the environment variables (Please refer to the "Parent Authorization Configuration" section for detailed instructions on locating the environment variables) and parameters and body (For reference on the location of the parameters tab, please see the "Pause an Aura Instance Example" ).
In case of any issues, please raise a support ticket with us, including details of the issue, like screenshots and error messages.
Important Note:
Please take note that the code and query examples provided in this knowledge base article are verified as of the publication date. However, it is crucial to be aware that these examples are provided "as is" and are susceptible to variations due to potential product changes.
We strongly recommend exercising caution. While we strive to maintain accuracy, certain adjustments might be necessary to ensure compatibility with any modifications or updates introduced over time.
Stay vigilant, and kindly verify and validate the code against the latest API documentation and resources available.
Comments
0 comments
Please sign in to leave a comment.