This page serves as a guide to assist you in getting started with the NexusRun DB API.
The API endpoints provided enable users to access and manipulate NexusRunDB databases. By making API calls with the appropriate authentication requirements, all functions available in the NexusRun portal can be performed programmatically.
Authentication
Users can access NexusRunDB API endpoints either using Basic or Bearer authentication. Authentication is not required for publicly accessible buckets.
Both authentication methods provide secure access to the NexusRunDB API, allowing users to perform authorized actions on the NexusRun databases.
Basic Authentication:
In Basic Authentication, need to include the "Authorization" header in your API request with the value "Basic accesskey:accesssecret". The access key and access secret are concatenated with a colon (:) and then base64 encoded.
Example:
curl --request GET \
--url https://{serverid}.nexusrun.com/databases/{databaseid}/ping \
--header 'authorization: Basic bXlhY2Nlc3NrZXk6bXlhY2Nlc3NzZWNyZXQ='
Bearer Authentication:
Bearer Authentication is used to authenticate API requests using a JWT (JSON Web Token). Users need to include the "Authorization" header in API request with the value "Bearer JWTToken". where the JWT token is generated using the "Token Generation" API with specific expiration limits. This authentication method allows for temporary access to the database without sharing access key and secret information.
Example:
curl --request GET \
--url https://{serverid}.nexusrun.com/databases/{databaseid}/ping \
--header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
Public Access:
When users want to assign a bucket access level for public, they can pass the asterisk ( * ) symbol as access key when calling 'Add New Permission' API. This indicates that the permission is granted to all users, without requiring any authentication or specific access keys.
It's important to note that public access to "list_all_buckets" is not permitted.
Master Access Key
When a new NexusRun database is created in the NexusRun portal, a Master access key is generated by default. The user will receive an email containing the master access key and master access secret. This master access key possesses all the permissions associated with the database.
Additionally, users have the ability to create normal access keys and assign specific read, read-write, list and delete permissions at the database bucket/key level.