Skip to main content

Upload File

You can upload a file (e.g. a category image) using this service. The returned url can then be used wherever the API expects an image URL.

Request

curl --location --request POST '<BASE_URL>/files' \
--header 'Authorization: Basic ZGVtbzpwQDU1dzByZA==' \
--form 'file=@"/path/to/image.png"' \
--form 'path="categories"'

Request Parameters (multipart/form-data)

ParameterTypeRequired
Description
fileFileYesThe file to upload.
pathStringNoAn optional folder/prefix to store the file under.

Response

200 OK
{
"path": "categories/8f14e45fceea167a5a36dedd4bea2543.png",
"url": "https://cdn.egaranti.com/categories/8f14e45fceea167a5a36dedd4bea2543.png"
}

Response Fields

FieldTypeDescription
pathStringThe storage path of the uploaded file
urlStringThe public URL of the uploaded file