Audience: Everyone
Environmental details: KOTS Self-Hosted and Cloud
Summary
When you have an attachment URL like: https://xxx/attachment/270/Jama_test.png, where 270 is not the actual attachment ID. While this URL works in a browser, using it in the Jama REST API results in “attachment not found.”
Note: The number in the URL section (e.g., 270) represents the attachment value, not the actual item ID of the attachment
IMPORTANT: Access to the REST API is limited to users with a Named Creator Jama Connect license, including endpoints in v1, labs, and SCIM. Users without a Named Creator Jama Connect license, including those with a Creator Float License, do not have access.
Solution
To fetch an attachment ID using the API when you only have the URL:
- Using the
GET /itemtypesendpoint, you can retrieve the itemtype ID for attachments.
Example: In my instance, the Itemtype ID for attachments is 22.
"data": [
{
"id": 22,
"typeKey": "ATT",
"display": "Attachment",
"displayPlural": "Attachments",
"description": "Attachment Type",
"image": "https://xxx/img/tree/attach.png",
"category": "ATTACHMENT",
"widgets": [
{
"name": "HISTORY",
"synchronize": false
- The
GET /abstractitemsAPI allows you to get all attachments in a project. Then, you can make a GET request to the abstract items API with the project ID and the itemtype ID as parameters. This will return all attachments for that specific project, including the AttachmentID you’re looking for.
- You can then use the
GET /attachments/{attachementID}/fileto download the attachment file from the attachment with the specified ID.
References
Please feel free to leave feedback in the comments below.
Comments
0 comments
Please sign in to leave a comment.