Post an item: File item
[POST] /v1/activities/{Activity_ID}/items

This method creates a new file item under a given Activity specified by the {Activity_ID} URL parameter.

A successful request returns 201 Created, and the location of the item in the response's Location header. For example, https://streamwork.com/v1/items/za0LXvWGjvyB8NjfUJ2E1X.


URL:
[POST] /v1/activities/{Activity_ID}/items
{Activity_ID}: The ID of an existing Activity you want to add the item to.


Response type:

text/html



Parameters:

Request example:

Example of Input_XML:

<?xml version="1.0" encoding="UTF-8"?>
<item name="My new activity item">"
  <description>Uploaded using cURL</description>
  <file_item/>
</item>

C:\cURL\Examples\New_file_item.xml



curl --request POST --insecure --header Expect: --header Content-Type:multipart/form-data
--header "Authorization: OAuth oauth_consumer_key=viM0dv0IZrrZ5qdMdsf3, oauth_nonce=LxHta1xXmsd5, oauth_signature_method=PLAINTEXT, oauth_timestamp=1309898322, oauth_version=1.0, oauth_token=S9Zhd7sjN1Y69U2CALMw, oauth_signature=CKhl1jONm0AHGvMmVVgPAONQ8BVZjlFii0zpTake%26q7Ij34EFohysyvkFR8SH9MtNtSbs23NMnR3FSRn4"
--form "item=@c:\curl\examples\New_file_item.xml;Content-Type=application/xml" --form "file=@c:\curl\examples\curl.pdf;Content-Type=application/pdf" https://streamwork.com/v1/activities/RYmqd1wcjLOznGXYaMT320/items

Note: The cURL script must be on a single line. Line breaks are added here for readability.


Response example:

New item created at https://streamwork.com/v1/items/za0LXvWGjvyB8NjfUJ2E1X



Back to SAP StreamWork Integration API