Hello,
I am running into an issue trying to call the Rest API Method using Powershell. I am sure I am calling the URL properly with my access token and other info. Although I am running into an issue.
I have a script that can Grab the users ID and Group Id I want to add them too. The Last step is confusing me.
$gId = $group.groupId
$aId = $user.accountId
$Headers = @{"Authorization"="Basic $($authinfo)"}
$id = @{
accountId = "$aId"
}
$body = $id | ConvertTo-Json
params = @{
Uri = "https://your-domain.atlassian.net/rest/api/3/group/user?groupId=$gId"
Method = 'POST'
Body = $body
ContentType = 'application/json'
}
Invoke-RestMethod @params -Headers $Headers
Output:
Invoke-RestMethod : The remote server returned an error: (400) Bad Request.
Changed URL to default - I replace my site in the script.