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)
| Parameter | Type | Required | Description |
|---|---|---|---|
| file | File | Yes | The file to upload. |
| path | String | No | An 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
| Field | Type | Description |
|---|---|---|
| path | String | The storage path of the uploaded file |
| url | String | The public URL of the uploaded file |