Home
Version 3
Service Bindings API

Service Bindings API

Create a Service Binding

POST /v2/service_bindings

Fields

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

Request

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyOSIsImVtYWlsIjoiZW1haWwtMTcwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzR9.vFTTlUlYR-oAZ__Be1LuijJjgMJA-W_Ow1Xo5CPXOxM
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_bindings

Body

{
  "service_instance_guid": "1b13a0b9-5841-4a7d-8491-2c94f5d55348",
  "app_guid": "dc453251-3889-4a4e-88b3-043795dd9182"
}

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "1b13a0b9-5841-4a7d-8491-2c94f5d55348",
  "app_guid": "dc453251-3889-4a4e-88b3-043795dd9182"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyOSIsImVtYWlsIjoiZW1haWwtMTcwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjQzMTAxMzR9.vFTTlUlYR-oAZ__Be1LuijJjgMJA-W_Ow1Xo5CPXOxM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/90060221-79cc-4cda-be8f-5128c2de99aa
X-VCAP-Request-ID: 20ed590f-2613-498a-a914-d566af63ad5b
Content-Length: 703
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "90060221-79cc-4cda-be8f-5128c2de99aa",
    "url": "/v2/service_bindings/90060221-79cc-4cda-be8f-5128c2de99aa",
    "created_at": "2015-02-12T01:42:13Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "dc453251-3889-4a4e-88b3-043795dd9182",
    "service_instance_guid": "1b13a0b9-5841-4a7d-8491-2c94f5d55348",
    "credentials": {
      "creds-key-391": "creds-val-391"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/dc453251-3889-4a4e-88b3-043795dd9182",
    "service_instance_url": "/v2/user_provided_service_instances/1b13a0b9-5841-4a7d-8491-2c94f5d55348"
  }
}