Hey, I’m trying to create atlas users using AWS IAM Authentication using administrative API and I’m currently facing issues with the format of the JSON payloads and the structure of the curl command.
currently, I’m using the below command, which gives an authorization error.
curl --user “:<PRIVATE-KEY” --digest
–header ‘Content-Type: application/json’
–include
–request PATCH https://cloud.mongodb.com/api/atlas/v2/groups//databaseUsers
–data ’
{
“awsIAMType”: “USER”,
“databaseName”: “$external”,
“groupId”: “”,
“roles”: [
{
“databaseName”: “sales”,
“CollectionName”: “test”,
“roleName”: “readWrite”
}
],
“username”: “< USER ARN>”
}'```
And the payload would throw the below error.
HTTP/2 401
date: Thu, 25 Apr 2024 10:26:21 GMT
www-authenticate: Digest realm="MMS Public API", domain="", nonce="sYAWln1laokBvhRXV5DWacdUEtQt+prX", algorithm=MD5, qop="auth", stale=false
content-length: 0
x-envoy-upstream-service-time: 3
server: mdbws
HTTP/2 406
date: Thu, 25 Apr 2024 10:26:22 GMT
strict-transport-security: max-age=31536000; includeSubdomains;
referrer-policy: strict-origin-when-cross-origin
x-permitted-cross-domain-policies: none
x-content-type-options: nosniff
content-type: application/json
content-length: 140
x-envoy-upstream-service-time: 9
server: mdbws
{"detail":"Invalid accept header or version date.","error":406,"errorCode":"INVALID_VERSION_DATE","parameters":[],"reason":"Not Acceptable"}zsh: command not found: --data
Any idea on what would be missing here.