Skip to content

Atlas#

To send data to MongoDB Atlas using its API, you can utilize Data Integration Center.

Prerequisites#

  • MongoDB Atlas Account
  • MongoDB Atlas cluster

Setup atlas#

  1. Enable Data API access.
  2. In the User tab, create a user and copy the API key.
  3. Copy URL Endpoint.

Info

To learn more details on MongoDB Atlas, see Introduction to the MongoDB Atlas Data API.

Atlas Setup

Create webhook#

  1. From the previous section, get the API url and append action/insertOne to it. Example:

    https://europe-west1.gcp.data.mongodb-api.com/app/data-kjqsw/endpoint/data/v1/action/insertOne
    
  2. As headers, set:

    • api-key: <api-key-from-previous-section>
    • Access-Control-Request-Headers: *
  3. As a body template, set e.g:

    {
      "collection":"devices",
      "database":"coiote",
      "dataSource":"coiote",
      "document": {
        "endpointName": "$endpointName"
      }
    }
    

    You can adjust the payload according to your needs.

Atlas Configuration

Atlas Headers

Investigate database#

Now, go to Collections and verify if there is a new entity.

Atlas Database


Last update: January 25, 2024