Post a timeline message

Posting a timeline message to suppliers, with or without attachments.

HTTP method Type

POST

Resource URL

/feeds

Parameters

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 Created
Server:Apache-Coyote/1.1
Set-Cookie:JSESSIONID=3421DFFD6EA3F0ED7EE154124B4FF51F; Path=/hsp/; HttpOnly
Location: http://hsis961:9090/hsp/rest/feeds/2577
Content-Length: 0
Date: 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.1
Content-Type: multipart/mixed; boundary=Boundary_1_1423506714_1333020950758
Authorization: Basic cG9ydGFsOnBvcnRhbA==
MIME-Version: 1.0
User-Agent: Java/1.6.0_21
Host: hsis961:9090
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Content-Length: 12495
 
--Boundary_1_1423506714_1333020950758
Content-Type: application/json
 
{"hpmSupplierId":"1323291296","message":"look what I got."}
--Boundary_1_1423506714_1333020950758
Content-Type: application/octet-stream
...
BINARY DATA
...
--Boundary_1_1423506714_1333020950758
Content-Type: text/plain
 
avatar.png
--Boundary_1_1423506714_1333020950758--