Post a timeline message
Posting a timeline message to suppliers, with or without attachments.
HTTP method Type
POSTResource URL
/feedsParameters
|
Parameter |
Type |
Required |
Description |
||
|
multipart |
JSON (multipart/mixed) (Request entity) |
yes |
The multipart is transfered in the request body. To send only a message without attachment, don't set the attachment and attachmentOriginalFileName body parts in the multipart object. To send a message with attachment you have to set all of the following body part parameters in the multipart object. An HTTP multipart consists of the following bodypart order: |
||
|
BodyPart |
MIME Type |
Description |
|||
|
1. feed object |
application/json |
includes the message of the feed and a hpmSupplierId to which the Feed will be posted. |
|||
|
2. attachment |
application/octet-stream |
the attachment binary data. |
|||
|
3. attachmentOriginalFileName |
text/plain |
the fileName plus extension of the attachment ( e.g avatar.png ) |
|||
the following diagram describes the multipart feed object object in UML:
Response
|
Return Value |
MediaType |
Description |
|
Only HTTP Header |
- |
Returns the URL to the created Feed. The URL is located in the HTML location header attribute. |
Example Response Header
HTTP/1.1 201 CreatedServer:Apache-Coyote/1.1Set-Cookie:JSESSIONID=3421DFFD6EA3F0ED7EE154124B4FF51F; Path=/hsp/; HttpOnlyLocation: http://hsis961:9090/hsp/rest/feeds/2577Content-Length: 0Date: Thu, 29 Mar 2012 11:35:50 GMT|
Return Codes |
Description |
|
HTTP 201 Status Code |
if creation of the feed was successful. |
|
HTTP 400 Status Code |
if multipart body part size not of the correct size. |
|
if multipart is invalid (wrong bodyPart sequence or insufficient/invalid bodyParts). |
|
|
if supplier try to send feed to another supplier. |
Example Usage:
POST http://hsis961:9090/hsp/rest/feeds HTTP/1.1Content-Type: multipart/mixed; boundary=Boundary_1_1423506714_1333020950758Authorization: Basic cG9ydGFsOnBvcnRhbA==MIME-Version: 1.0User-Agent: Java/1.6.0_21Host: hsis961:9090Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2Connection: keep-aliveContent-Length: 12495--Boundary_1_1423506714_1333020950758Content-Type: application/json{"hpmSupplierId":"1323291296","message":"look what I got."}--Boundary_1_1423506714_1333020950758Content-Type: application/octet-stream...BINARY DATA...--Boundary_1_1423506714_1333020950758Content-Type: text/plainavatar.png--Boundary_1_1423506714_1333020950758--