Description
Below is code in Powershell I am trying to run to upload a simple test picture, I’m posting because I’ve been using the API for 2 months now, and I’ve used every single call except this one, and I just seem to be missing something, but I’m not sure what. No matter what I do I receive the 500 internal server error, I copied and pasted the code generation from the API page, I feel as if I’m misunderstanding this API call. Any input appreciated.
$headers=@{}
$headers.Add(“content-type”, “multipart/form-data;”)
$headers.Add(“authorization”, “Bearer token”)
$body = @{}
$body.Add(“pic_file”, “C:\Temp\pic.jpg”)
$response = Invoke-RestMethod -Uri ‘https://api.zoom.us/v2/users/testuser@gmail.com/picture’ -Method POST -Headers $headers -Body $body
Error
Invoke-RestMethod : The remote server returned an error: (500) Internal Server Error.
At line:6 char:13
- $response = Invoke-RestMethod -Uri 'https://api.zoom.us/v2/users/test …
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
- FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT
Which Endpoint/s?
POST # /users/{userId}/picture
How To Reproduce (If applicable)
Screenshots (If applicable)
Additional context
Add any other context about the problem here.