How to upload an image to IXON Cloud
An image can be uploaded to IXON Cloud by using the endpoint PublicFileUpload. To use a file from your local disk, you can reference it by using an @
in the body (payload).
curl --request POST \
--url "<<url>>:443/api/public-files/upload" \
--header 'Api-Version: 2' \
--header "Api-Application: $application_id" \
--header "Api-Company: $company_id" \
--header 'content-type: application/json' \
--header "Authorization: Bearer $bearer_token"
--header 'Content-Type: image/jpeg' \
--data '@/C:/Users/MyUser/Downloads/MyImage.jpg'
This returns a public URL to the picture which can be used in the PageComponent endpoint. For a usage example, see your browser's network log (F12) when changing a picture on a component.
The following mime types are supported:
- image/gif
- image/jpeg
- image/png
- image/svg+xml
- image/tiff
- image/webp
- image/x-icon
- image/vnd.microsoft.icon
Updated over 1 year ago