[DOCS-11720] Atlas "Add Teams to Project" API Endpoint Correction Created: 18/May/18  Updated: 08/Jun/18  Resolved: 06/Jun/18

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

Type: Improvement Priority: Major - P3
Reporter: Luke Phillippi Assignee: Robert Justice (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 5 years, 38 weeks, 5 days ago

 Description   

Currently, the Add Teams to a Project section of the Atlas API documentation states that the request body should include a roles parameter that is an object array:

...
[ { "teamId" : "{TEAM-ID}", "roles" : [ { "roleName" : "GROUP_OWNER" } ] } ]
...

However, if this syntax is used, the following response is received:

{
  "detail" : "Invalid attribute roles specified.",
  "error" : 400,
  "errorCode" : "INVALID_ATTRIBUTE",
  "parameters" : [ "roles" ],
  "reason" : "Bad Request"
}

The correct syntax for the request body appears to mirror the response returned via the Get Teams Assigned to a Project API endpoint; a request body parameter, roleNames, which references an array of strings. For example, the following API call succeeds:

curl -u "username:apiKey" --digest \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--request POST "https://cloud.mongodb.com/api/atlas/v1.0/groups/{GROUP-ID}/teams?pretty=true"
--data '[ { "teamId" : "{TEAM-ID}", "roleNames" : [ "GROUP_DATA_ACCESS_READ_ONLY" ] } ]'

The the Add Teams to a Project section of the Atlas API documentation section of the documentation should be updated accordingly.


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