Adding Images via the API
You can upload an image to a work item using the Advance API. Using this method, you can also associate existing image values in Advance to which you have access permissions with your work item.
If you are displaying an interview, your end-users can use the image upload feature in Advance to upload images directly to the work item.
Prerequisites
- The template used for the work item must ask an Image variable.
- The default maximum file size for images is 10MB.
- JPEG and PNG file formats are supported.
You cannot upload images to a work item that has an in progress version.
To upload an image value to a work item
- (If required) Create a new work item, passing in answer XML in the body of the request.
- Once you have uploaded the answer XML, Advance checks to find if any Image variables asked have existing image values in Advance to which the user has permissions. If any existing image values are found, Advance automatically associates the image reference to the work item version, avoiding the need to upload the image again.
- Advance sends an HTTP 200 response showing which image references have been found and which images you should upload.
- Using the list of image values required, upload each image in the body of the following request:
- PUT /WorkItems/{workItemId}/Images/{imageReference}
- Advance sends an HTTP 200 response to confirm the image has been uploaded.
- Create a new work item version.
Advance updates the image references. When the document is assembled, the image values show as answered.