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": "dc37397d-92d0-4959-a28f-442ed7f608fc",
  "app_guid": "fa1c5650-b3f4-4e75-9d14-74147687e9a9",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNSIsImVtYWlsIjoiZW1haWwtMjg2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2OTl9.g_K1G6csHKX3iG_kumdAa6j5HYorZF8X5FC2hvDkOQA
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": "dc37397d-92d0-4959-a28f-442ed7f608fc",
  "app_guid": "fa1c5650-b3f4-4e75-9d14-74147687e9a9",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTQxNSIsImVtYWlsIjoiZW1haWwtMjg2QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0NTE0MTM2OTl9.g_K1G6csHKX3iG_kumdAa6j5HYorZF8X5FC2hvDkOQA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "144740b6-b9c4-48d4-9c30-f408d8c47ec3",
    "url": "/v2/service_bindings/144740b6-b9c4-48d4-9c30-f408d8c47ec3",
    "created_at": "2015-12-22T18:28:19Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "fa1c5650-b3f4-4e75-9d14-74147687e9a9",
    "service_instance_guid": "dc37397d-92d0-4959-a28f-442ed7f608fc",
    "credentials": {
      "creds-key-637": "creds-val-637"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/fa1c5650-b3f4-4e75-9d14-74147687e9a9",
    "service_instance_url": "/v2/user_provided_service_instances/dc37397d-92d0-4959-a28f-442ed7f608fc"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/144740b6-b9c4-48d4-9c30-f408d8c47ec3
X-VCAP-Request-ID: 
Content-Length: 703
X-Content-Type-Options: nosniff