/mongodb-atlas-api-resources

This repo contains a Postman project containing a full set of APIs calls to all resources provided by MongoDB Atlas.

mongodb-atlas-api-resources

This repo contains a Postman project containing a full set of APIs calls to all resources provided by MongoDB Atlas.


Description

This is a repo with a Postman collection containing all avaiable API calls (as of August 2021) to help you understand and build automation/integration with MongoDB Atlas.


Setup

1. Configure Laptop

  • Download and install Postman on your laptop
  • Training on Postman is available and it has been chosen by its popularity

2. Configure MongoDB Atlas

  • Create a free MongoDB Atlas account to have access to a free cluster to play around in. Make sure you create an organization and a project. Don't skip that step. Here is a coupon code GOATLAS10 for some credits to explore more features (valid as of August 2021). Watch this [video] (https://www.youtube.com/watch?v=FxeQ5eck3tw) to learn how to add these credits to your account.
  • Create a dedicated database deployment (cluster). Use a M10 tier or higher to have full access to all of the APIs resources*. Feel free to explore all of the other options, but the default options should be fine for this example.
  • Create an API key with Organization Owner privileges and save the public/private key to use when calling APIs. Also, don't forget to add your laptop/workstation IP to the API access list.
  • Navigate to your Project Settings and retrieve your Project ID so it can be used in one of our examples below.

PROJ

3. Configure and use Postman

  • Import the MongoDB-Atlas.postman_collection.json collection and Atlas.postman_environment.json environment variables found in this repo into your Postman workspace.
  • Click on the MongoDB Atlas Collection. Under the Authorization tab, choose the Digest Auth Type and use the public key as the user and the private key as your password.

AUTH

  • Open up the Get All Clusters API call under the cluster folder.

FOLDER

  • Make sure you select the Atlas environment variables and update the Postman variable ProjectID value to your Project ID captured in the previous steps. VARIABLES ENV

  • Execute the API call by hitting the Send button and you should get a response containing a list of all your clusters (database deployments) alongside the cluster details, like whether backup is enabled or the cluster is running.

API

Now explore all the APIs available to create your own automation.

Tips

Once you have imported this collection you will notice that we have a folder sturcture following the order showed in the MongoDB Atlas API Resources Documentation. Inside the folders you will find all the APIs calls to that specific resource. Each call will have a sample request, but for more options on the same API call check the documentation. You can find the direct link to the documentation on the documentation section in Postman.

Folder structure

FOLDER

Documentation link on the documentation section of Postman DOCUMENTATION

One last tip: Once you have tested all your API calls to build your automation, Postman allows you to export that in code snippets in your favorite programming language.

CODE1 CODE2

Please always refer to the online documentation for any changes or new resources. Also, feel free to make pull requests to update the project with new API resources, fixes, and enhancements.