Description
Uploads and assigns an image in the format of jpg, png, gif to a segment. Last upload will remain in the subsequent uploads to the same segment.
In case update fails or is aborted, old image stay in the segment.
The maximum size of an image is 150kb.
-
The user must be authenticated and have write permissions to the segment's siteGroup.
Request
The request object has multipart-form-data type and has the following part fields.
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
Identifier for the segment to be assigned with image. |
|
|
String |
Yes |
Site group which segment is updating. |
|
|
Binary |
Yes |
Image file to be assigned to the specified segment. |
Response
The response for a successful query is an empty object: {"status":"ok"}
Examples
$ curl -X POST -H 'X-cXense-Authentication: ...' -F segmentId=8nop087ng0iq -F siteGroupId=1135172335968227720 -F img=@Sport.jpg https://api.cxense.com/segment/image/upload
{"status":"ok"}