After looking through posts as well as the .ps1 files being used in the AD sync tool, I was trying to run some simple data gathering api calls to get a feel for things however when I try to run a 'get_current_user' I get an error that it was expecting a null body but received data. If I forgoe adding a body property, it states
"Invoke-RestMethod : Error in call to API function "users/get_current_account": request body: could not decode input as JSON".
$authorization = "Bearer [redacted]"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", $authorization)
$ContentType = 'application/json;charset=utf-8'
$uri = "https://api.dropboxapi.com/2/users/get_current_account"
$json = "{}"
$body = ([System.Text.Encoding]::UTF8.GetBytes($json))
Invoke-RestMethod -Uri $uri -Headers $headers -Body $body -ContentType $ContentType -Method post
Error:
Invoke-RestMethod : Error in call to API function "users/get_current_account": request body: expected null, got value
At line:8 char:1
+ Invoke-RestMethod -Uri $uri -Headers $headers -Body $body -ContentTyp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand