[DOCS-12864] API - Create a database user - corrections in example request Created: 08/Jul/19  Updated: 29/Oct/23  Resolved: 08/Jul/19

Status: Closed
Project: Documentation
Component/s: Atlas
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: Holly Barnett Assignee: Jeffrey Allen
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 4 years, 31 weeks, 2 days ago

 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.)



 Comments   
Comment by Jeffrey Allen [ 08/Jul/19 ]

Thanks for filing holly.barnett. Just published this fix.

Generated at Thu Feb 08 08:06:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.