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": "6d43880a-17ce-4c88-81e1-e43d967b6f67",
  "app_guid": "104ceb62-d9af-4922-a6ae-26adc872d7e7",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzOSIsImVtYWlsIjoiZW1haWwtMTA3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTgzOTd9.IvRkbLyNNh0mnA9Iz5xpB1hGCZbI8huswKoGEvqdRdY
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": "6d43880a-17ce-4c88-81e1-e43d967b6f67",
  "app_guid": "104ceb62-d9af-4922-a6ae-26adc872d7e7",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEzOSIsImVtYWlsIjoiZW1haWwtMTA3QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NjE5NTgzOTd9.IvRkbLyNNh0mnA9Iz5xpB1hGCZbI8huswKoGEvqdRdY" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5f3bb2e1-7b84-4e98-a074-fae2afc476f9",
    "url": "/v2/service_bindings/5f3bb2e1-7b84-4e98-a074-fae2afc476f9",
    "created_at": "2016-04-22T19:33:17Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "104ceb62-d9af-4922-a6ae-26adc872d7e7",
    "service_instance_guid": "6d43880a-17ce-4c88-81e1-e43d967b6f67",
    "credentials": {
      "creds-key-20": "creds-val-20"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/104ceb62-d9af-4922-a6ae-26adc872d7e7",
    "service_instance_url": "/v2/user_provided_service_instances/6d43880a-17ce-4c88-81e1-e43d967b6f67"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/5f3bb2e1-7b84-4e98-a074-fae2afc476f9
X-VCAP-Request-ID: 69e71424-ec06-4d52-a655-b86bfe43ff63
Content-Length: 701
X-Content-Type-Options: nosniff