# Uploading User Pictures via API - 500 internal server error

**URL:** <https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746>\
**Category:** API and Webhooks\
**Created:** [December 18, 2020, 4:41pm UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746 "2020-12-18T16:41:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.brandl](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/s.brandl/32/20350_2.png) [@s.brandl](https://devforum.zoom.us/u/s.brandl)\
**Post date:** [December 18, 2020, 4:41pm UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746/1 "2020-12-18T16:41:14Z")

</div>

**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](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](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.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [December 18, 2020, 9:50pm UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746/2 "2020-12-18T21:50:05Z")

</div>

Hey @s.brandl,

Thank you for reaching out to the Zoom Developer Forum. Have you had a chance to test this in a REST client such as cURL or Postman? We have an excellent collection of requests in our [Postman Collection](https://marketplace.zoom.us/docs/guides/guides/postman) that you can use for testing.

If you’re seeing the same issue in a REST client, please provide the request details that you are using for the REST client and I’ll investigate this further. If the request works in the REST client, I would review the script to ensure that it is performing the same steps as the REST client.

I hope that helps! Let me know if you have any questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![s.brandl](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/s.brandl/32/20350_2.png) [@s.brandl](https://devforum.zoom.us/u/s.brandl)\
**Post date:** [January 7, 2021, 9:02pm UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746/3 "2021-01-07T21:02:43Z")

</div>

Wanted to make sure I looped back around on this:

- Thank you! for the suggestion to use Postman I can’t believe I’ve been doing APIs for this long, and I’ve never heard of this program.

- Note for users trying to run the ‘Update a User’s Profile Picture’ the API web interface will not do it justice, as it can not see your desktop/file explorer to inject/parse the jpg file. Use postman to see some great code generation

- Note for Powershell developers, multi-form data does not perform on Powershell v5.1 (the last version of powershell distributed by Microsoft automatically) I needed to upgrade to powershell 7 to get the code generated by Postman to work. I did not test Powershell v6, I jumped right to 7. Regardless, get up to the latest version of Powershell, the Zoom/Postman developers have put some serious work into keeping the methods up to date with the latest version tested.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 8, 2021, 9:15pm UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746/4 "2021-01-08T21:15:34Z")

</div>

Hey @s.brandl,

I’m glad to hear that was helpful! Postman is a great tool for testing APIs. As always, let us know if you encounter any further issues or questions.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [February 8, 2021, 7:15am UTC](https://devforum.zoom.us/t/uploading-user-pictures-via-api-500-internal-server-error/38746/5 "2021-02-08T07:15:37Z")

</div>

Closed on February 8, 2021, 7:15am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
