Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Upload Bits for a Package of type bits

POST /v3/packages/:guid/upload

Request

Route

POST /v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06/upload

Parameters

Name Description Valid Values Example Values
bits A binary zip file containing the package bits
bits_name=application.zip&bits_path=%2Ftmp%2Fd20151007-23074-1cnqkvw%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyOSIsImVtYWlsIjoiZW1haWwtMjk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDZ9.CAKQwBWkQcblSJOd3JBc7PM7-gMUBB11z7oQPM4Izg8
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20151007-23074-1cnqkvw%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQyOSIsImVtYWlsIjoiZW1haWwtMjk3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQ3ODI5NDZ9.CAKQwBWkQcblSJOd3JBc7PM7-gMUBB11z7oQPM4Izg8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

200 OK

Body

{
  "guid": "guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06",
  "type": "bits",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "error": null,
  "created_at": "2015-10-07T00:35:46Z",
  "updated_at": "2015-10-07T00:35:46Z",
  "links": {
    "self": {
      "href": "/v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06"
    },
    "upload": {
      "href": "/v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06/upload",
      "method": "POST"
    },
    "download": {
      "href": "/v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06/download",
      "method": "GET"
    },
    "stage": {
      "href": "/v3/packages/guid-ab3a2fc4-5f81-4107-b5d0-2a92afcccf06/droplets",
      "method": "POST"
    },
    "app": {
      "href": "/v3/apps/guid-767a1327-02e8-4927-8aa2-5aa958789aa5"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 66805566-6b1d-4255-85a7-8d27b6d9374c
Content-Length: 849
X-Content-Type-Options: nosniff