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": "a02c4f75-bbfb-4f97-a5f5-8915801b703c",
  "app_guid": "3b6eb7a6-ae71-4073-aaaf-017b79fa9f29",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDV9.Q8TkGydFkYz59xoBSABgBmBM-m9txXDESUJtdbePO_M
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": "a02c4f75-bbfb-4f97-a5f5-8915801b703c",
  "app_guid": "3b6eb7a6-ae71-4073-aaaf-017b79fa9f29",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI0OSIsImVtYWlsIjoiZW1haWwtMTQ2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NDQyNjA2NDV9.Q8TkGydFkYz59xoBSABgBmBM-m9txXDESUJtdbePO_M" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "1aa5a355-b414-4425-9bd5-a174bc80154e",
    "url": "/v2/service_bindings/1aa5a355-b414-4425-9bd5-a174bc80154e",
    "created_at": "2015-09-30T23:30:45Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "3b6eb7a6-ae71-4073-aaaf-017b79fa9f29",
    "service_instance_guid": "a02c4f75-bbfb-4f97-a5f5-8915801b703c",
    "credentials": {
      "creds-key-316": "creds-val-316"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/3b6eb7a6-ae71-4073-aaaf-017b79fa9f29",
    "service_instance_url": "/v2/user_provided_service_instances/a02c4f75-bbfb-4f97-a5f5-8915801b703c"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/1aa5a355-b414-4425-9bd5-a174bc80154e
X-VCAP-Request-ID: 8dd2a1ed-282c-41d7-90cb-0da94057ecd4
Content-Length: 703
X-Content-Type-Options: nosniff