Image_Add#
Description#
This function allows you to add an image to the store.
Note
The file must first exist on the server at the path specified before calling this function, unless a base64 encoded image is supplied via the optional Image_Data parameter. Use FTP to upload the file to the server or the Miva admin.
Request Body Parameters#
| Parameter | Type | Description |
|---|---|---|
Filepath |
String | Relative file path to the image (relative to mm5 folder). The file must already exist on the server, unless Image_Data is provided. |
Image_Data |
String | Optional. A base64 encoded image. When provided, the image file will be created from this data at the specified Filepath. |
Response Parameters#
| Parameter | Type | Description |
|---|---|---|
success |
Boolean | Boolean value for if the request was successful |
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Image_Add",
"Filepath": "graphics/00000001/logo-min.png"
}
Example Response#
{
"success": 1
}
base64 encoded#
Example Request#
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "Image_Add",
"Filepath": "graphics/00000001/NEW.jpg",
"Image_Data": "ADD_BASE64_IMAGE_HERE"
}
Error Responses#
| Error Code | Error Message | Error Description |
|---|---|---|
| MER-JSN-IMG-00009 | Invalid image extension | The file extension of the provided Filepath is not valid. |
| MER-DBE-IMG-00001 | Image filepaths must be local and relative to the Base Directory for Graphics | Filepath is not a local relative path. |