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": "06ad16d5-e5cc-4f31-8ddd-2a2f8b935aa7",
  "app_guid": "58d4698c-7c29-4b57-bdd1-f26922a26860",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2M30.Lsd3cagQJeXgnD-0TRXcbSptpezWGXxqRdkpguk9J1U
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": "06ad16d5-e5cc-4f31-8ddd-2a2f8b935aa7",
  "app_guid": "58d4698c-7c29-4b57-bdd1-f26922a26860",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMiLCJlbWFpbCI6ImVtYWlsLTNAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQ1ODg1NTY2M30.Lsd3cagQJeXgnD-0TRXcbSptpezWGXxqRdkpguk9J1U" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "2024e4fe-352f-42a3-839e-b376d70a47a8",
    "url": "/v2/service_bindings/2024e4fe-352f-42a3-839e-b376d70a47a8",
    "created_at": "2016-03-17T21:41:03Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "58d4698c-7c29-4b57-bdd1-f26922a26860",
    "service_instance_guid": "06ad16d5-e5cc-4f31-8ddd-2a2f8b935aa7",
    "credentials": {
      "creds-key-7": "creds-val-7"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/58d4698c-7c29-4b57-bdd1-f26922a26860",
    "service_instance_url": "/v2/user_provided_service_instances/06ad16d5-e5cc-4f31-8ddd-2a2f8b935aa7"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/2024e4fe-352f-42a3-839e-b376d70a47a8
X-VCAP-Request-ID: 
Content-Length: 699
X-Content-Type-Options: nosniff