REST API - Add Artifact Request
11 min
api/v1/projects/{projectid}/artifacts description adds a single artifact to the specified project url structure \[blueprint uri]/api/v1/projects/{projectid}/artifacts projectid the id of the project that you want to add the artifact to supported methods post docid\ hsi lzxs8g rx ydudzkg request body the new artifact must be defined in the body of the request read more about rest api defining an artifact in the request body docid\ hcshzb757u afe9zrglzp blueprint result codes your response may contain resultcode and message parameters if your request involves changes to blueprint data these parameters provide detailed information about the result of your request 201 (successfully created) 401 (unauthorized) the user does not have edit permissions for the artifact 404 (not found) artifact not found in the project artifact type not found 410 (invalid value) this error can occur for a variety of reasons, such as some of artifact properties have invalid values (the error is on the artifact level if any artifact properties have errors ) no properties are specified to be updated the property value cannot be empty custom value and choices cannot be specified simultaneously property does not support custom values only single choice is allowed specified choice value does not exist value must be less than the maximum value value must be greater than the minimum value limited count of decimal places invalid rich text property value specified user or group does not exist 416 (cannot update read only property) read only property cannot be changed id property cannot be updated 417 (invalid artifact property type) unsupported artifact property type property not found the property type has been removed image property update is not supported 420 (incorrect folder structure) only the project or another folder can be the parent for the folder artifact 500 (error) a system error has occurred 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 docid\ hsi lzxs8g rx ydudzkg or patch docid\ rcjvhrlby6de zgkehxui 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/222996/artifacts request body \<?xml version="1 0" ?> \<artifact xmlns\ i="http //www w3 org/2001/xmlschema instance" xmlns="http //www blueprintsys com/blueprint/api/v1"> \<artifacttypeid>25\</artifacttypeid> \<name>new textual requirement\</name> \<parentid>10\</parentid> \<properties> \<property> \<propertytypeid>235658\</propertytypeid> \<textorchoicevalue>sample description\</textorchoicevalue> \</property> \<property> \<numbervalue>15\</numbervalue> \<propertytypeid>235659\</propertytypeid> \</property> \</properties>\</artifact> 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/222996/artifacts request body { "name" "new textual requirement", "parentid" 10, "artifacttypeid" 25, "properties" \[ { "propertytypeid" 235658, "textorchoicevalue" "sample description" }, { "propertytypeid" 235659, "numbervalue" 15 0 } ]} 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 } ] }