Hello.
I would like to update the tracking code in PowerShell, but when I run the following code, I get a 400 error.
$token = "<access token>"
$uri = 'https://api.box.com/2.0/users/<user id>'
$headers = @{"Authorization" = "Bearer " + $token}
$body = [System.Text.Encoding]::UTF8.GetBytes("tracking_codes": [ { "type": "tracking_code", "name":"<tracking code name>",value":"<tracking code value> "}])
Invoke-RestMethod -Method Put -Uri $uri -Headers $headers -Body $body -ContentType 'application/json'
▼Error content
+ Invoke-RestMethod -Method Put -Uri $uri -Headers $headers -Body $body ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Could you please let me know if there is any part of the code that is wrong?