Home
Version 3
Service Bindings API

Service Bindings API

Create a Service Binding

POST /v2/service_bindings

Request

Route

POST /v2/service_bindings

Body

Name Description Default Valid Values Example Values
service_instance_guid The guid of the service instance to bind
app_guid The guid of the app to bind
binding_options A hash of options that are passed to v1 brokers
parameters Arbitrary parameters to pass along to the service broker. Must be a JSON object
{
  "service_instance_guid": "2909e1b9-1e70-42e6-a6e1-67d2fa81ee71",
  "app_guid": "72ae0608-e822-4660-a97a-ab70cf9017a7",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NSIsImVtYWlsIjoiZW1haWwtMTc2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1Mjd9.fdi_Oy3gxfMWb9fTDTyUcmm440IAu0qRY43iI815CVo
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "2909e1b9-1e70-42e6-a6e1-67d2fa81ee71",
  "app_guid": "72ae0608-e822-4660-a97a-ab70cf9017a7",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0NSIsImVtYWlsIjoiZW1haWwtMTc2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDk1MzE1Mjd9.fdi_Oy3gxfMWb9fTDTyUcmm440IAu0qRY43iI815CVo" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "b68e8b0a-5a24-40b3-a3b3-0f83e5027add",
    "url": "/v2/service_bindings/b68e8b0a-5a24-40b3-a3b3-0f83e5027add",
    "created_at": "2015-11-30T23:38:47Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "72ae0608-e822-4660-a97a-ab70cf9017a7",
    "service_instance_guid": "2909e1b9-1e70-42e6-a6e1-67d2fa81ee71",
    "credentials": {
      "creds-key-390": "creds-val-390"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/72ae0608-e822-4660-a97a-ab70cf9017a7",
    "service_instance_url": "/v2/user_provided_service_instances/2909e1b9-1e70-42e6-a6e1-67d2fa81ee71"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/b68e8b0a-5a24-40b3-a3b3-0f83e5027add
X-VCAP-Request-ID: 
Content-Length: 703
X-Content-Type-Options: nosniff