saveProductPicture

Attach a new picture to a product, or replace an existing picture.

To retrieve a list of images attached to a product, call getProducts and see the element "images". To remove a picture, use deleteProductPicture.

For an identical call which does not require the picture parameter to be base64-encoded, seee saveProductPicture2.

Input parameters

Parameter name Description Possible value Required
productPictureID Use productPictureID to edit or replace an existing image. You may edit general information of the file (productID, pictureName) or replace/update the file as well, as needed. integer
productID Product ID. For new pictures, this field is required. integer
pictureName A descriptive name for the image string
picture Contents of the binary image file, base64-encoded.

If file content is missing, API returns error 1090. If it cannot be base64-decoded, API returns error 1091.
Data
filename File name. If omitted, API will generate a random name for the image. string
url Instead of uploading a file, it is possible to just provide a URL that points to the image file in an external location (a content delivery network). This feature is for internal purposes only and NOT recommended for use!

Must start with http:// or https://, otherwise API returns error 1015.
string
hostingProvider To be used with parameter "url". This should be a mutually-agreed classifier, identifying the CDN where the image is located. Erply needs it to know how to manipulate the remote images.

Must consist of letters and numbers only ([A-Za-z0-9]*), otherwise API returns error 1015. It cannot be used in conjunction with local image files (API will return error 1013).
string

Response

Field name Type Description
productPictureID integer ID of the newly-created item