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": "e7c6b6bc-f6e7-4405-b54c-c1c3bfeef56e",
  "app_guid": "57aeb228-5e3e-4186-847b-6e9a376fc938",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwNSIsImVtYWlsIjoiZW1haWwtODRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMjc3NDk4M30.vCTYr3N8_CxLqs2-pt4hGEPX_k0Qn0uYSkvl6ccd47U
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": "e7c6b6bc-f6e7-4405-b54c-c1c3bfeef56e",
  "app_guid": "57aeb228-5e3e-4186-847b-6e9a376fc938",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwNSIsImVtYWlsIjoiZW1haWwtODRAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQzMjc3NDk4M30.vCTYr3N8_CxLqs2-pt4hGEPX_k0Qn0uYSkvl6ccd47U" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "47c4a1be-c1aa-42f6-9b64-2fe7f5149726",
    "url": "/v2/service_bindings/47c4a1be-c1aa-42f6-9b64-2fe7f5149726",
    "created_at": "2015-05-21T01:03:03Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "57aeb228-5e3e-4186-847b-6e9a376fc938",
    "service_instance_guid": "e7c6b6bc-f6e7-4405-b54c-c1c3bfeef56e",
    "credentials": {
      "creds-key-185": "creds-val-185"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/57aeb228-5e3e-4186-847b-6e9a376fc938",
    "service_instance_url": "/v2/user_provided_service_instances/e7c6b6bc-f6e7-4405-b54c-c1c3bfeef56e"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/47c4a1be-c1aa-42f6-9b64-2fe7f5149726
X-VCAP-Request-ID: 940c5601-4f7c-43d4-b3af-fd639904fba6
Content-Length: 703
X-Content-Type-Options: nosniff