WhatsApp Cloud API更新企业头像报错:已上传JPG图片仍提示“请上传JPG图片”
Hey, I’ve run into similar media handling quirks with the WhatsApp Business Graph API before—let’s break down what might be causing this "Image type not supported" error and fix it step by step.
First, let’s recap your issue to make sure I’m on the same page: you successfully uploaded JPG images via the Resumable Upload API and got a valid file handle, but when using that handle to update your WhatsApp business profile, you keep getting an OAuthException (code 1, subcode 3441012) saying the image type isn’t supported—even after trying multiple JPG files.
Here are the most likely fixes to try:
1. Verify your image’s actual format (not just the file extension)
It’s common for files to have a .jpg extension but actually be saved as another format (like a PNG renamed to JPG). The WhatsApp API checks the file’s internal signature, not just the extension.
- On Linux/macOS, run this terminal command to confirm the real format:
You should see output likefile your-image-file.jpgyour-image-file.jpg: JPEG image data, ... - On Windows, right-click the file > Properties > Details > Check "Type of file" (it should say "JPEG Image")
If it’s not a true JPEG, re-export it as a proper JPG using an editor like GIMP, Photoshop, or even Paint.
2. Explicitly set Content-Type: image/jpeg during upload
When you uploaded your image to the Resumable Upload API, did you specify the correct content type header? The API uses this to categorize the media, and omitting it can lead to the file handle being tagged incorrectly.
Make sure your upload request includes this header:
-H 'Content-Type: image/jpeg'
If you used a library or script instead of curl, double-check that the Content-Type is set to image/jpeg for the upload request.
3. Regenerate a fresh file handle and use it immediately
Occasionally, file handles can become invalid if there’s a delay between upload and usage, or if the upload process had an unseen glitch.
- Re-upload your confirmed JPG to the Resumable Upload API, ensuring no errors pop up during the upload.
- Copy the new
file_handleimmediately and plug it into your profile update request right away.
4. Upgrade your Graph API version
You’re using v14.0, which is an older release (from 2022). WhatsApp has fixed several media-handling bugs in newer API versions. Try updating your request URL to use v18.0 (the latest stable version as of now):
curl -X POST \ 'https://graph.facebook.com/v18.0/PHONE_NUMBER_ID/whatsapp_business_profile' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ -d '{ "messaging_product": "whatsapp", "address": "ADDRESS", "description": "DESCRIPTION", "vertical": "INDUSTRY", "email": "EMAIL", "websites": [ "https://WEBSITE-1", "https://WEBSITE-2" ], "profile_picture_handle": "YOUR_NEW_HANDLE" }'
5. Confirm your image meets WhatsApp’s profile requirements
WhatsApp has strict specs for business profile pictures that can sometimes trigger unexpected errors:
- Minimum resolution: 192x192 pixels
- Maximum file size: 5 MB
- No transparent backgrounds (JPG doesn’t support transparency, but exports from PNGs with transparency may have artifacts)
Resize or compress your image to meet these rules, then re-upload and try the profile update again.
内容的提问来源于stack exchange,提问作者yiddishe-kop

