Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12864

API - Create a database user - corrections in example request

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Fixed
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Atlas
    • None

    Description

      Description

      In the example request, there is a missing slash which results in an error.

      Doc link: https://docs.atlas.mongodb.com/reference/api/database-users-create-a-user/

      Please adjust

      --request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/databaseUsers"
      

      to

      --request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/databaseUsers" \
      

       

      There appears to be a stray comma after the username that results in an error

       "username" : "david", 

      to 

       "username" : "david" 

       

      Complete example request: 

       

      curl --user "{USERNAME}:{APIKEY}" --digest \
        --header "Accept: application/json" \
        --header "Content-Type: application/json" \
        --include \
        --request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/5356823b3794dee37132bb7b/databaseUsers" \
        --data '
          {
            "databaseName" : "admin",
            "password" : "changeme123",
            "roles" : [ {
              "databaseName" : "sales",
              "roleName" : "readWrite"
            }, {
              "databaseName" : "marketing",
              "roleName" : "read"
            } ],
            "username" : "david"
          }' 

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Activity

          People

            jeffrey.allen@mongodb.com Jeffrey Allen
            holly.barnett@mongodb.com Holly Barnett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              4 years, 31 weeks, 2 days ago