Home
Version 3
Packages (Experimental) API

Packages (Experimental) API

Copy a Package

POST /v3/apps/:guid/packages

Request

Route

POST /v3/apps/guid-ec6cca09-66d4-4796-917b-8884321f6a4b/packages?source_package_guid=guid-4eb496c2-4758-43c7-ab11-a2da3a244894

Parameters

Name Description Valid Values Example Values
source_package_guid The package to copy from
source_package_guid: guid-4eb496c2-4758-43c7-ab11-a2da3a244894

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2MSIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTZ9.IMrRWidXTHdiJ22Osm-ssGp3FEjXkC76LdrQH9I2ORo
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v3/apps/guid-ec6cca09-66d4-4796-917b-8884321f6a4b/packages?source_package_guid=guid-4eb496c2-4758-43c7-ab11-a2da3a244894" -d '' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE2MSIsImVtYWlsIjoiZW1haWwtMTE1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5yZWFkIiwiY2xvdWRfY29udHJvbGxlci53cml0ZSJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0Mzg2NDE3OTZ9.IMrRWidXTHdiJ22Osm-ssGp3FEjXkC76LdrQH9I2ORo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "guid": "f3d7a4fa-b642-474e-8afc-2e28de0be3f6",
  "type": "url",
  "hash": {
    "type": "sha1",
    "value": null
  },
  "url": "http://awesome-sauce.com",
  "state": "READY",
  "error": null,
  "created_at": "2015-07-27T22:43:16Z",
  "updated_at": null,
  "_links": {
    "self": {
      "href": "/v3/packages/f3d7a4fa-b642-474e-8afc-2e28de0be3f6"
    },
    "app": {
      "href": "/v3/apps/guid-ec6cca09-66d4-4796-917b-8884321f6a4b"
    }
  }
}

Headers

Content-Type: application/json;charset=utf-8
X-VCAP-Request-ID: 5ece694e-f081-45c0-826d-eb76e1c90c0a
Content-Length: 452
X-Content-Type-Options: nosniff