REST API - Get Artifact Request
9 min
/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 head docid\ eqnd3zptd6dwf3go3ufox get docid 7hm2r py7e84xk2msf11b 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 at least one uri or request body parameter is invalid, such as one of the filter docid\ sv9gjverxczcgqdn28j7u , traces, offset or limit parameters a required value has not been provided if you are submitting a post # or patch # request and have not added the x http method override parameter to your request header 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 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 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 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 } ]}