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": "21858a2a-c7eb-465c-8b82-a22fbdef3066",
  "app_guid": "7ab23029-a79f-477c-91bc-8dbe92336ce8",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1NDQ1MTYwNX0.0BSFAUemC5EODxvXnF5pWZLGzRrcG1Zpdw9j3SSR5e0
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": "21858a2a-c7eb-465c-8b82-a22fbdef3066",
  "app_guid": "7ab23029-a79f-477c-91bc-8dbe92336ce8",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIiLCJlbWFpbCI6ImVtYWlsLTJAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1NDQ1MTYwNX0.0BSFAUemC5EODxvXnF5pWZLGzRrcG1Zpdw9j3SSR5e0" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "033399ec-4c18-44cd-9d93-cdc15270570d",
    "url": "/v2/service_bindings/033399ec-4c18-44cd-9d93-cdc15270570d",
    "created_at": "2016-01-26T22:20:05Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "7ab23029-a79f-477c-91bc-8dbe92336ce8",
    "service_instance_guid": "21858a2a-c7eb-465c-8b82-a22fbdef3066",
    "credentials": {
      "creds-key-5": "creds-val-5"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/7ab23029-a79f-477c-91bc-8dbe92336ce8",
    "service_instance_url": "/v2/user_provided_service_instances/21858a2a-c7eb-465c-8b82-a22fbdef3066"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/033399ec-4c18-44cd-9d93-cdc15270570d
X-VCAP-Request-ID: 
Content-Length: 699
X-Content-Type-Options: nosniff