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": "b576e9e0-89f4-49f9-a2ff-5cc05fca98c1",
  "app_guid": "b51e3c54-24cf-4b54-8e08-4c3e0fcb9c2a",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyNiIsImVtYWlsIjoiZW1haWwtMTMwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NDV9.zy9VZRt36oehdyxwkV6tEH40TxcSL6ePl5IeXLXcq-E
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": "b576e9e0-89f4-49f9-a2ff-5cc05fca98c1",
  "app_guid": "b51e3c54-24cf-4b54-8e08-4c3e0fcb9c2a",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyNiIsImVtYWlsIjoiZW1haWwtMTMwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDU1NTc5NDV9.zy9VZRt36oehdyxwkV6tEH40TxcSL6ePl5IeXLXcq-E" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "c084e724-a431-473c-9d39-65d88aa45472",
    "url": "/v2/service_bindings/c084e724-a431-473c-9d39-65d88aa45472",
    "created_at": "2015-10-15T23:52:25Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "b51e3c54-24cf-4b54-8e08-4c3e0fcb9c2a",
    "service_instance_guid": "b576e9e0-89f4-49f9-a2ff-5cc05fca98c1",
    "credentials": {
      "creds-key-292": "creds-val-292"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/b51e3c54-24cf-4b54-8e08-4c3e0fcb9c2a",
    "service_instance_url": "/v2/user_provided_service_instances/b576e9e0-89f4-49f9-a2ff-5cc05fca98c1"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/c084e724-a431-473c-9d39-65d88aa45472
X-VCAP-Request-ID: 49c680ab-a130-4379-bfa9-a75f093e58c2
Content-Length: 703
X-Content-Type-Options: nosniff