Creates a new file

HTTP Request

POST /api/v1/portfolio/{{portfolioId}}/file

Example Header

POST /api/v1/portfolio/{{portfolioId}}/file HTTP/1.1
Host: {{DOMAIN}}
Content-Type: multipart/form-data; boundary=----032a1ab685934650abbe059cb45d6ff3
Accept: application/json
Authorization: {{sessionId}

Info

Require sessionId
Require Editor, Admin role

Parameters

Parameter Type Require Default Description
portfolioId String Yes The ID of the portfolio.
field String Yes cover, draftingProcess or additionalDocument
description String The description of file.

Request Body

------032a1ab685934650abbe059cb45d6ff3
Content-Disposition: form-data; name="file"; filename="Screen Shot 2017-09-01 at 17.31.21.png"
Content-Type: image/png

{{file}} (BINARY OF FILE)
------032a1ab685934650abbe059cb45d6ff3
Content-Disposition: form-data; name="field"

{{field}}
------032a1ab685934650abbe059cb45d6ff3
Content-Disposition: form-data; name="description"

{{description}}
------032a1ab685934650abbe059cb45d6ff3--

Response Data

{
    "fileId": "59ab5a476ad1da55fc3f1ebd",
    "createdTime": 1504401991
}

Response Code

Code Result Description
201 success The new file was created successfully.
400 error The request is malformed or missing some required parameters.
401 error Unauthorized token or the session_id was expired.