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
{
  "service_instance_guid": "e228f151-18b1-4fa7-9092-941a6c8f20de",
  "app_guid": "0280596c-af7f-4def-ae6b-80e3decc669b"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MyIsImVtYWlsIjoiZW1haWwtMTQ1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5Njd9.EiPWnfuet03NfqZ6-nxvbBnSA9NFl3A4IpToaiGaomA
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": "e228f151-18b1-4fa7-9092-941a6c8f20de",
  "app_guid": "0280596c-af7f-4def-ae6b-80e3decc669b"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTE4MyIsImVtYWlsIjoiZW1haWwtMTQ1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjczMjM5Njd9.EiPWnfuet03NfqZ6-nxvbBnSA9NFl3A4IpToaiGaomA" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "4644241f-b3a8-4ddf-a2ba-553e4d0af025",
    "url": "/v2/service_bindings/4644241f-b3a8-4ddf-a2ba-553e4d0af025",
    "created_at": "2015-03-18T22:52:47Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "0280596c-af7f-4def-ae6b-80e3decc669b",
    "service_instance_guid": "e228f151-18b1-4fa7-9092-941a6c8f20de",
    "credentials": {
      "creds-key-317": "creds-val-317"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/0280596c-af7f-4def-ae6b-80e3decc669b",
    "service_instance_url": "/v2/user_provided_service_instances/e228f151-18b1-4fa7-9092-941a6c8f20de"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/4644241f-b3a8-4ddf-a2ba-553e4d0af025
X-VCAP-Request-ID: 2aee9843-bb02-4351-93a4-0b4b1a2edecf
Content-Length: 703
X-Content-Type-Options: nosniff