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": "eed7e870-d08a-4e67-b201-bcdc36eccb30",
  "app_guid": "d447e495-8821-44c8-9d57-6bdcb300165e",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxMyIsImVtYWlsIjoiZW1haWwtMzEwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTR9.mvsfozXN4gz1W7QyQaSco5xhuYsgaj6oQmxJnAdYsJ4
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": "eed7e870-d08a-4e67-b201-bcdc36eccb30",
  "app_guid": "d447e495-8821-44c8-9d57-6bdcb300165e",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxMyIsImVtYWlsIjoiZW1haWwtMzEwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTg1OTk0NTR9.mvsfozXN4gz1W7QyQaSco5xhuYsgaj6oQmxJnAdYsJ4" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "6fcba2c2-8fee-4f68-af34-68ed1ebe1e58",
    "url": "/v2/service_bindings/6fcba2c2-8fee-4f68-af34-68ed1ebe1e58",
    "created_at": "2016-03-14T22:30:54Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "d447e495-8821-44c8-9d57-6bdcb300165e",
    "service_instance_guid": "eed7e870-d08a-4e67-b201-bcdc36eccb30",
    "credentials": {
      "creds-key-71": "creds-val-71"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/d447e495-8821-44c8-9d57-6bdcb300165e",
    "service_instance_url": "/v2/user_provided_service_instances/eed7e870-d08a-4e67-b201-bcdc36eccb30"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/6fcba2c2-8fee-4f68-af34-68ed1ebe1e58
X-VCAP-Request-ID: 
Content-Length: 701
X-Content-Type-Options: nosniff