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": "f10d01e9-796a-4395-8e48-78e0ea8ee5bb",
  "app_guid": "9677dcfc-dce2-4bad-8ab4-6a1ff857e7bf",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2OCIsImVtYWlsIjoiZW1haWwtMTg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTF9.8pXyYhEPLYOHVu97RDFv3QNVSxWDNn7EvRAJ2PLOy-k
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": "f10d01e9-796a-4395-8e48-78e0ea8ee5bb",
  "app_guid": "9677dcfc-dce2-4bad-8ab4-6a1ff857e7bf",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI2OCIsImVtYWlsIjoiZW1haWwtMTg1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzY4Mjk3OTF9.8pXyYhEPLYOHVu97RDFv3QNVSxWDNn7EvRAJ2PLOy-k" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "e49547cc-6c54-4a9a-939e-6d42e4f65257",
    "url": "/v2/service_bindings/e49547cc-6c54-4a9a-939e-6d42e4f65257",
    "created_at": "2015-07-06T23:23:11Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "9677dcfc-dce2-4bad-8ab4-6a1ff857e7bf",
    "service_instance_guid": "f10d01e9-796a-4395-8e48-78e0ea8ee5bb",
    "credentials": {
      "creds-key-405": "creds-val-405"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/9677dcfc-dce2-4bad-8ab4-6a1ff857e7bf",
    "service_instance_url": "/v2/user_provided_service_instances/f10d01e9-796a-4395-8e48-78e0ea8ee5bb"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/e49547cc-6c54-4a9a-939e-6d42e4f65257
X-VCAP-Request-ID: eecadb18-d53c-45ea-927b-5d345950312e
Content-Length: 703
X-Content-Type-Options: nosniff