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-5170f568-6185-4190-9bd2-574f829af609/upload

Parameters

Name Description Valid Values Example Values
bits A binary zip file containing the package bits

Body

Name Description Default Valid Values Example Values
bits_name=application.zip&bits_path=%2Ftmp%2Fd20150320-21406-123bdvh%2Fapplication.zip

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzQ4MDgzOX0.ThQBUI2aDkBa3NO7H6Yob8Cj6Shgn-7OR4JEdHqR-SY
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/packages/guid-5170f568-6185-4190-9bd2-574f829af609/upload" -d 'bits_name=application.zip&bits_path=%2Ftmp%2Fd20150320-21406-123bdvh%2Fapplication.zip' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLnJlYWQiLCJjbG91ZF9jb250cm9sbGVyLndyaXRlIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyNzQ4MDgzOX0.ThQBUI2aDkBa3NO7H6Yob8Cj6Shgn-7OR4JEdHqR-SY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "guid-5170f568-6185-4190-9bd2-574f829af609",
  "type": "bits",
  "hash": null,
  "url": null,
  "state": "PROCESSING_UPLOAD",
  "error": null,
  "created_at": "2015-03-20T18:27:19Z",
  "_links": {
    "self": {
      "href": "/v3/packages/guid-5170f568-6185-4190-9bd2-574f829af609"
    },
    "upload": {
      "href": "/v3/packages/guid-5170f568-6185-4190-9bd2-574f829af609/upload"
    },
    "app": {
      "href": "/v3/apps/guid-8656669b-93a2-4a27-8234-e0b5fa9c1918"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: eb06c3c1-ef59-428c-94ac-d73cb3612238
Content-Length: 493
X-Content-Type-Options: nosniff