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
{
  "service_instance_guid": "d5fed8b7-9ec9-4a71-9201-2047a7d4e41b",
  "app_guid": "85974a98-974e-42d9-be34-b714d39fe2fb"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUiLCJlbWFpbCI6ImVtYWlsLTVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyOTAzODY5Nn0.fdiMy22qfhPIexlv8VE3GH9Ff41Fpxbt8MbZIJRcmFc
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": "d5fed8b7-9ec9-4a71-9201-2047a7d4e41b",
  "app_guid": "85974a98-974e-42d9-be34-b714d39fe2fb"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTUiLCJlbWFpbCI6ImVtYWlsLTVAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQyOTAzODY5Nn0.fdiMy22qfhPIexlv8VE3GH9Ff41Fpxbt8MbZIJRcmFc" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "47b9a494-e5a9-4edb-a2c3-4abfc69bd49e",
    "url": "/v2/service_bindings/47b9a494-e5a9-4edb-a2c3-4abfc69bd49e",
    "created_at": "2015-04-07T19:11:35Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "85974a98-974e-42d9-be34-b714d39fe2fb",
    "service_instance_guid": "d5fed8b7-9ec9-4a71-9201-2047a7d4e41b",
    "credentials": {
      "creds-key-21": "creds-val-21"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/85974a98-974e-42d9-be34-b714d39fe2fb",
    "service_instance_url": "/v2/user_provided_service_instances/d5fed8b7-9ec9-4a71-9201-2047a7d4e41b"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/47b9a494-e5a9-4edb-a2c3-4abfc69bd49e
X-VCAP-Request-ID: 4938fca2-c830-4593-abbf-981910c9e26d
Content-Length: 701
X-Content-Type-Options: nosniff