update_image
To set or change a unit icon, execute the unit/update_image method.
To copy an icon from another unit, use the following signature:
svc=unit/update_image¶ms={
"itemId": <long>,
"oldItemId": <long>
}
To use an icon from the library, use the following signature:
svc=unit/update_image¶ms={
"itemId": <long>,
"libId": <long>,
"path": <text>
}
Parameters
The request must contain the following parameters:
Parameter | Description |
---|---|
itemId | ID of the unit to which you want to apply the icon. |
olditemId | ID of the unit from which you want to copy the icon. |
libId | ID of the resource in which the necessary image is stored. To use the default library, pass 0. |
path | Path to the image file. |
Response
If the request is completed successfully, an empty object is returned:
{}
Otherwise, an error code is returned.
Error codes
Error code | Description |
---|---|
4 | Wrong input parameters. |
6 | Failed to set or change the unit icon. |
7 | No ADF_ACL_ITEM_EDIT_IMAGE access right to the unit. |