Uploads one or more icons into an icon folder of the profile. Today the only folder is drawing_custom_icons, the custom icon set of the Drawing element.
Request body
A single { "file_data": ... } object or a JSON array of them. file_data is the base64-encoded image. Each image must be PNG or JPEG and at most 256 KB; anything else fails that item with Unsupported Media Type or Payload Too Large.
Limit
The server's icon limit is counted per folder: icons in drawing_custom_icons do not count towards the default page-icon folder, and the other way round. Once the folder is full, each further item fails with Profile has reached the limit of icons.
HTTP status
201every item was stored207some items failed and some did not400every item failed401no valid bearer token403not an internal client app, or another profile'sprofile_id404folderis not an allowed icon folder
Authorization
Restricted to internal client apps, the same as POST /profiles/{profile_id}/icons.
Responses
-
Created - every icon was stored. A single object in the request returns a single
IconOutcome; an array returns an array, in request order. -
Multi-Status - some icons were stored and some failed. The body has the same shape as
201; failed items carryerror_messageinstead ofurl. -
Bad Request - every icon failed. The body has the same shape as
201, with anerror_messageon each item (for example a missingfile_data,Payload Too Large,Unsupported Media TypeorProfile has reached the limit of icons). -
Unauthorized - missing or invalid bearer token.
-
Forbidden - the token is not from an internal client app, or
profile_idis not the caller's own profile. -
Not Found -
folderis not an allowed icon folder, orprofile_iddoes not exist.
curl \
--request POST 'https://api.iformbuilder.com/exzact/api/v81/[servername]/profiles/self/icons/drawing_custom_icons' \
--header "Content-Type: application/json" \
--header "Authorization: Bearer {access_token}" \
--data '{
"file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}'
{
"file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
[
{
"file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
},
{
"file_data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
}
]
{
"url": "https://zerion-iform-icons-example.s3.amazonaws.com/app/67890/drawing_custom_icons/field_17306240006721a2f0b1c3d.png"
}
[
{
"url": "https://zerion-iform-icons-example.s3.amazonaws.com/app/67890/drawing_custom_icons/field_17306240006721a2f0b1c3d.png"
},
{
"error_message": "Profile has reached the limit of icons"
}
]
{
"error_message": "Profile has reached the limit of icons"
}