REST API - Get Artifact Request
/api/v1/projects/{projectId}/artifacts/{artifactId}?status={status}&comments={comments}&traces={traces}&attachments={attachments}&richtextasplain={richtextasplain}&inlinecss={inlinecss}&content={content}
Description
Retrieves a single artifact by Project ID and Artifact ID and returns information about the artifact.
URL Structure
[Blueprint_URI]/api/v1/projects/{ProjectId}/artifacts/{ArtifactId}
ProjectId
: The ID of the project that contains the artifact with the attachment you want to retrieve.ArtifactId
: The ID of the artifact containing the attachment you want to retrieve.
Supported Methods
Request URI Parameters
Status
(optional): Defines whether or not the status of the artifact should be loaded. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value.Comments
(optional): Indicates whether to retreive comments of the artifact. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value.Traces
(optional): Indicates whether to retrieve traces of the artifact. Valid options include: None, All, Parent, Child, Manual, Reuse and Other. The default is None if not specified. The default is All if the parameter is included in the URI with no given value.Attachments
(optional): Indicates whether to retrieve information about the attachments of the artifact. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value.RichTextAsPlain
(optional): Defines whether or not to retrieve all rich-text properties as Plain Text instead of HTML. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value.InlineCSS
(optional): Defines whether or not to retrieve all rich-text properties with locally defined or inline styles. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value. When this parameter is set to false, rich-text properties return internal styles that are defined within the<head>
section of the HTML.Content
(optional): Defines whether or not to retrieve the artifact's content. This parameter can be set to true or false. The default is false if not specified. The default is true if the parameter is included in the URI with no given value.
HTTP Status Codes
- 200: OK
- 201: Successfully Created
- 206: Partial Content
- 400: Bad Request
This error can occur for a variety of reasons: - 401: Unauthorized
- The Blueprint token is missing, invalid or expired.
- 403: Forbidden
- The applicable permissions are needed. For example, this error can occur when:
- An Author or Collaborate license is needed for access.
- Comment permissions are needed on the artifact.
- Edit permissions are needed on the change summary job.
- The applicable permissions are needed. For example, this error can occur when:
- 404: NotFound
- Item is not found in the project. For example, this error can occur when:
- Artifact not found.
- Artifact type not found.
- Project not found.
- ALM target not found.
- Change summary job not found.
- User does not have edit permissions for this artifact, project or ALM target.
- Item is not found in the project. For example, this error can occur when:
- 409: Conflict
- Reason for failure can be found in the response body. Additional information may also be found in the log.
- 411: Length Required
- If the Content-Length header is missing in the request.
- 413: Request Entity Too Large
- If the provided file size is larger than allowed.
- 415: Unsupported Media Type
- If the provided media type is not of MIME Multipart Content "form-data."
- 416: Request Range Not Satisfiable
- If
offset
points to a part of a collection that is not available.
- If
- 500: Internal Server Error
- 501: Not Implemented
Examples
XML Example
Request URI
https://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405715?comments=true&traces=all&properties=true&attachments=true
Response Header
{'content-length': '4669', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'date': 'Tue, 07 May 2013 16:56:47 GMT', 'expires': '-1', 'content-type': 'application/xml; charset=utf-8', 'server': 'Blueprint'}
Response Body
<?xml version="1.0" ?>
<Artifact xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.blueprintsys.com/blueprint/api/v1">
<AreAttachmentsReadOnly>true</AreAttachmentsReadOnly>
<AreDocumentReferencesReadOnly>true</AreDocumentReferencesReadOnly>
<AreTracesReadOnly>true</AreTracesReadOnly>
<ArtifactTypeId>317929</ArtifactTypeId>
<ArtifactTypeName>ReUse_TReq</ArtifactTypeName>
<Attachments>
<Attachment>
<FileName>EditReservations.txt</FileName>
<Id>103542</Id>
<IsReadOnly>true</IsReadOnly>
<Link>http://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405715/attachments/103542</Link>
</Attachment>
</Attachments>
<BaseArtifactType>TextualRequirement</BaseArtifactType>
<BlueprintUrl>http://production.blueprintcloud.com?ArtifactId=4405715</BlueprintUrl>
<Comments>
<Comment>
<Author>
<DisplayName>Default Instance Admin</DisplayName>
<Id>1</Id>
</Author>
<Description><html><head><style type="text/css">.c0 { padding: 1px 0px 0px; font-size: 11px } .c1 { font-size: 11px } .c2 { margin: 0px; font-size: 11px } </style></head><body class="c0"><div class="c1"><p class="c2"><span class="c1">Please review.</span></p></div></body></html></Description>
<Id>53978</Id>
<LastModified>2014-12-22T19:49:31.8270000Z</LastModified>
<Version>2</Version>
<IsClosed>false</IsClosed>
<Status>Open</Status>
</Comment>
</Comments>
<Id>4405715</Id>
<Name>Edit Reservations</Name>
<ParentId>4405707</ParentId>
<ProjectId>4405707</ProjectId>
<Properties>
<Property>
<BasePropertyType>Text</BasePropertyType>
<IsReadOnly>true</IsReadOnly>
<IsRichText>false</IsRichText>
<Name>ID</Name>
<PropertyTypeId>304155</PropertyTypeId>
<TextOrChoiceValue>TR_RU4405715</TextOrChoiceValue>
</Property>
<Property>
<BasePropertyType>Text</BasePropertyType>
<IsRichText>false</IsRichText>
<Name>Name</Name>
<PropertyTypeId>304156</PropertyTypeId>
<TextOrChoiceValue>Edit Reservations</TextOrChoiceValue>
</Property>
<Property>
<BasePropertyType>Text</BasePropertyType>
<IsRichText>true</IsRichText>
<Name>Description</Name>
<PropertyTypeId>304157</PropertyTypeId>
<TextOrChoiceValue><html><head><style type="text/css">.c0 { padding: 1px 0px 0px; font-size: 10.6700000762939px } .c1 { font-size: 10.6700000762939px } .c2 { margin: 0px; font-size: 10.6700000762939px } .c3 { font-size: 10.6700000762939px; line-height: 1.45000004768372 } </style></head><body class="c0"><div class="c1"><p class="c2"><span class="c3"><span class="c1">BP Air needs to allow customers to edit their reservations online.</span></span></p></div></body></html></TextOrChoiceValue>
</Property>
<Property>
<BasePropertyType>User</BasePropertyType>
<Name>ApprovedBy</Name>
<PropertyTypeId>304320</PropertyTypeId>
<UsersAndGroups />
</Property>
<Property>
<BasePropertyType>Choice</BasePropertyType>
<Choices />
<Name>ItemType</Name>
<PropertyTypeId>304323</PropertyTypeId>
</Property>
<Property>
<BasePropertyType>User</BasePropertyType>
<IsReadOnly>true</IsReadOnly>
<Name>Created By</Name>
<PropertyTypeId>304195</PropertyTypeId>
<UsersAndGroups>
<UserGroup i:type="User">
<DisplayName>Default Instance Admin</DisplayName>
<Id>1</Id>
</UserGroup>
</UsersAndGroups>
</Property>
<Property>
<BasePropertyType>Date</BasePropertyType>
<DateValue>2014-12-22T19:39:30.0500000Z</DateValue>
<IsReadOnly>true</IsReadOnly>
<Name>Created On</Name>
<PropertyTypeId>304196</PropertyTypeId>
</Property>
<Property>
<BasePropertyType>User</BasePropertyType>
<IsReadOnly>true</IsReadOnly>
<Name>Last Edited By</Name>
<PropertyTypeId>304197</PropertyTypeId>
<UsersAndGroups>
<UserGroup i:type="User">
<DisplayName>Default Instance Admin</DisplayName>
<Id>1</Id>
</UserGroup>
</UsersAndGroups>
</Property>
<Property>
<BasePropertyType>Date</BasePropertyType>
<DateValue>2014-12-22T19:40:01.7970000Z</DateValue>
<IsReadOnly>true</IsReadOnly>
<Name>Last Edited On</Name>
<PropertyTypeId>304198</PropertyTypeId>
</Property>
</Properties>
<Traces>
<Trace>
<ArtifactId>4405707</ArtifactId>
<ArtifactPropertyName>BP Airways 3.0</ArtifactPropertyName>
<BlueprintUrl>http://production.blueprintcloud.com?ArtifactId=4405707</BlueprintUrl>
<Direction>From</Direction>
<IsSuspect>false</IsSuspect>
<Label>4405707: BP Airways 3.0</Label>
<Link>http://production.blueprintcloud.com/api/v1/projects/4405707</Link>
<ProjectId>4405707</ProjectId>
<Type>Parent</Type>
</Trace>
<Trace>
<ArtifactId>4405714</ArtifactId>
<ArtifactPropertyName>Reserve Online</ArtifactPropertyName>
<BlueprintUrl>http://production.blueprintcloud.com?ArtifactId=4405714</BlueprintUrl>
<Direction>From</Direction>
<IsSuspect>true</IsSuspect>
<Label>4405714: Reserve Online</Label>
<Link>http://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405714</Link>
<ProjectId>4405707</ProjectId>
<Type>Reuse</Type>
</Trace>
</Traces>
<Version>2</Version>
</Artifact>
JSON Example
Request URI
https://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405715?comments=true&traces=all&properties=true&attachments=true
Response Header
{'content-length': '3180', 'pragma': 'no-cache', 'cache-control': 'no-cache', 'date': 'Tue, 07 May 2013 16:52:58 GMT', 'expires': '-1', 'content-type': 'application/json; charset=utf-8', 'server': 'Blueprint'}
Response Body
{
"Id": 4405715,
"Name": "Edit Reservations",
"ProjectId": 4405707,
"Version": 2,
"ParentId": 4405707,
"BlueprintUrl": "http://production.blueprintcloud.com?ArtifactId=4405715",
"ArtifactTypeId": 317929,
"ArtifactTypeName": "ReUse_TReq",
"BaseArtifactType": "TextualRequirement",
"AreTracesReadOnly": true,
"AreAttachmentsReadOnly": true,
"AreDocumentReferencesReadOnly": true,
"Properties": [
{
"PropertyTypeId": 304155,
"Name": "ID",
"BasePropertyType": "Text",
"TextOrChoiceValue": "TR_RU4405715",
"IsRichText": false,
"IsReadOnly": true
},
{
"PropertyTypeId": 304156,
"Name": "Name",
"BasePropertyType": "Text",
"TextOrChoiceValue": "Edit Reservations",
"IsRichText": false
},
{
"PropertyTypeId": 304157,
"Name": "Description",
"BasePropertyType": "Text",
"TextOrChoiceValue": "<html><head><style type=\"text/css\">.c0 { padding: 1px 0px 0px; font-size: 10.6700000762939px } .c1 { font-size: 10.6700000762939px } .c2 { margin: 0px; font-size: 10.6700000762939px } .c3 { font-size: 10.6700000762939px; line-height: 1.45000004768372 } </style></head><body class=\"c0\"><div class=\"c1\"><p class=\"c2\"><span class=\"c3\"><span class=\"c1\">BP Air needs to allow customers to edit their reservations online.</span></span></p></div></body></html>",
"IsRichText": true
},
{
"PropertyTypeId": 304320,
"Name": "ApprovedBy",
"BasePropertyType": "User",
"UsersAndGroups": []
},
{
"PropertyTypeId": 304323,
"Name": "ItemType",
"BasePropertyType": "Choice",
"Choices": []
},
{
"PropertyTypeId": 304195,
"Name": "Created By",
"BasePropertyType": "User",
"UsersAndGroups": [
{
"Type": "User",
"Id": 1,
"DisplayName": "Default Instance Admin"
}
],
"IsReadOnly": true
},
{
"DateValue": "2014-12-22T19:39:30.0500000Z",
"PropertyTypeId": 304196,
"Name": "Created On",
"BasePropertyType": "Date",
"IsReadOnly": true
},
{
"PropertyTypeId": 304197,
"Name": "Last Edited By",
"BasePropertyType": "User",
"UsersAndGroups": [
{
"Type": "User",
"Id": 1,
"DisplayName": "Default Instance Admin"
}
],
"IsReadOnly": true
},
{
"DateValue": "2014-12-22T19:40:01.7970000Z",
"PropertyTypeId": 304198,
"Name": "Last Edited On",
"BasePropertyType": "Date",
"IsReadOnly": true
}
],
"Comments": [
{
"LastModified": "2014-12-22T19:49:31.8270000Z",
"IsClosed": false,
"Status": "Open",
"Id": 53978,
"Author": {
"Type": "User",
"Id": 1,
"DisplayName": "Default Instance Admin"
},
"Version": 2,
"Description": "<html><head><style type=\"text/css\">.c0 { padding: 1px 0px 0px; font-size: 11px } .c1 { font-size: 11px } .c2 { margin: 0px; font-size: 11px } </style></head><body class=\"c0\"><div class=\"c1\"><p class=\"c2\"><span class=\"c1\">Please review.</span></p></div></body></html>"
}
],
"Traces": [
{
"Type": "Parent",
"Direction": "From",
"ProjectId": 4405707,
"ArtifactId": 4405707,
"ArtifactPropertyName": "BP Airways 3.0",
"Label": "4405707: BP Airways 3.0",
"BlueprintUrl": "http://production.blueprintcloud.com?ArtifactId=4405707",
"Link": "http://production.blueprintcloud.com/api/v1/projects/4405707",
"IsSuspect": false
},
{
"Type": "Reuse",
"Direction": "From",
"ProjectId": 4405707,
"ArtifactId": 4405714,
"ArtifactPropertyName": "Reserve Online",
"Label": "4405714: Reserve Online",
"BlueprintUrl": "http://production.blueprintcloud.com?ArtifactId=4405714",
"Link": "http://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405714",
"IsSuspect": true
}
],
"Attachments": [
{
"Id": 103542,
"FileName": "EditReservations.txt",
"Link": "http://production.blueprintcloud.com/api/v1/projects/4405707/artifacts/4405715/attachments/103542",
"IsReadOnly": true
}
]
}