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": "ebee40cb-ea3c-4fa1-ba29-9e739485db47",
  "app_guid": "5e55f5df-3fb3-4fcd-8488-0da6a817ac91",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0OSIsImVtYWlsIjoiZW1haWwtMjQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDZ9.XSHV5lvOP8JL2fbgeP6F1kqAuBCwvtT_zV8bQAG7Bn8
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": "ebee40cb-ea3c-4fa1-ba29-9e739485db47",
  "app_guid": "5e55f5df-3fb3-4fcd-8488-0da6a817ac91",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTM0OSIsImVtYWlsIjoiZW1haWwtMjQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDI2MDE1NDZ9.XSHV5lvOP8JL2fbgeP6F1kqAuBCwvtT_zV8bQAG7Bn8" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "54136621-8e29-4186-a185-781b46a3b04b",
    "url": "/v2/service_bindings/54136621-8e29-4186-a185-781b46a3b04b",
    "created_at": "2015-09-11T18:39:06Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "5e55f5df-3fb3-4fcd-8488-0da6a817ac91",
    "service_instance_guid": "ebee40cb-ea3c-4fa1-ba29-9e739485db47",
    "credentials": {
      "creds-key-555": "creds-val-555"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/5e55f5df-3fb3-4fcd-8488-0da6a817ac91",
    "service_instance_url": "/v2/user_provided_service_instances/ebee40cb-ea3c-4fa1-ba29-9e739485db47"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/54136621-8e29-4186-a185-781b46a3b04b
X-VCAP-Request-ID: d02358d4-ac73-4cc7-a857-cc46f06938b3
Content-Length: 703
X-Content-Type-Options: nosniff