Skip to main content

Upload Graphic

POST 

/libraries/:libraryId/graphics

Upload a new graphic to a library. The content type for this API call must be multipart/form-data.

The following table shows the allowed content-types for the graphics file:

File TypeContent Type
jpegimage/jpeg
gifimage/gif
pngimage/png
Use of Graphic in Product

Notice: Uploaded files may be attached to surveys and can be accessed by anyone who has the corresponding URL. This feature should only be used for non-confidential files.

Try It Out Feature Limitation

Unfortunately, this feature will not let you upload files. To test this feature, it's suggested you run the cURL example.

You can upload a file from a remote host, or you can upload a file from your local drive.

Example request body for uploading file from a remote host:

{
"name": "imageName",
"fileUrl": "https://fileLocation.com/imageName.png",
"contentType": "contentType",
"folder": "libraryFolderName"
}

Example request body for uploading file from a local drive:

\{
"file": "@/home/images/imageName.png",
"folder": "libraryFolderName"
\}

<Heading
id={"request"}
as={"h2"}
className={"openapi-tabs__heading"}
>
<Translate id="theme.openapi.request.title">Request</Translate>
</Heading>

<ParamsDetails
{...require("./upload-graphic.ParamsDetails.json")}
>

</ParamsDetails>

<RequestSchema
{...require("./upload-graphic.RequestSchema.json")}
>

</RequestSchema>

<StatusCodes
{...require("./upload-graphic.StatusCodes.json")}
>

</StatusCodes>