Trouble when uploading UserImage by API | Community
Skip to main content

Trouble when uploading UserImage by API

  • January 12, 2024
  • 1 reply
  • 0 views

Hello,
I am facing an issue while trying to upload an image via the User Images endpoints, I follow this documentation: https://developer.zendesk.com/api-reference/help_center/help-center-api/user_images/
The first call: POST /api/v2/guide/user_images/uploads is working as expected, I get the upload URL and a correct header containing the right content-type.
The second call: PUT <upload_url> is also working as expected, I am getting a 201 Created response.
But when I try to call POST /api/v2/guide/user_images with the token from the first call and the right brand_id I always get a HTTP 400 with the details :

{
    "errors": [
        {
            "title": "Invalid user image",
            "code": "UserImageInvalid",
            "status": 400,
            "meta": {
                "reasons": "/content_type should be equal to one of the allowed values"
            }
        }
    ]
}

I've tried to inspect the upload process on my help center frontend, but when I make the same calls (changing values) it fails everytime... I really don’t know what I am missing here.


Thanks for your help !
Mallaury

1 reply

Hi Mallaury,
 
Can you share the content type value you're providing in the POST to /api/v2/guide/user_images/uploads?