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.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNSIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDh9.K8Bt06UU8ydPsipAr8tUIovD1rzAqt_rImlDR2EltJg
Host: example.org
Content-Type: application/x-www-form-urlencoded
Cookie: 

Route

POST /v2/service_bindings

Body

{
  "service_instance_guid": "3303ab9d-61d8-4a1b-ab93-2517f7f7da62",
  "app_guid": "1d4ab7a2-51d2-4167-8718-973004f36cbd"
}

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "3303ab9d-61d8-4a1b-ab93-2517f7f7da62",
  "app_guid": "1d4ab7a2-51d2-4167-8718-973004f36cbd"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIzNSIsImVtYWlsIjoiZW1haWwtMTc1QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjIzMjM1NDh9.K8Bt06UU8ydPsipAr8tUIovD1rzAqt_rImlDR2EltJg" \
	-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/cf5e10da-ff83-40c3-983d-5534dc82eaa1
X-VCAP-Request-ID: 1cb20709-4271-4ffd-83ba-a441dfe2c4d3
Content-Length: 708
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "cf5e10da-ff83-40c3-983d-5534dc82eaa1",
    "url": "/v2/service_bindings/cf5e10da-ff83-40c3-983d-5534dc82eaa1",
    "created_at": "2015-01-20T01:52:28+00:00",
    "updated_at": null
  },
  "entity": {
    "app_guid": "1d4ab7a2-51d2-4167-8718-973004f36cbd",
    "service_instance_guid": "3303ab9d-61d8-4a1b-ab93-2517f7f7da62",
    "credentials": {
      "creds-key-402": "creds-val-402"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/1d4ab7a2-51d2-4167-8718-973004f36cbd",
    "service_instance_url": "/v2/user_provided_service_instances/3303ab9d-61d8-4a1b-ab93-2517f7f7da62"
  }
}