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

Route

POST /v2/service_bindings

Body

{
  "service_instance_guid": "76d60ec2-a82f-4312-81b7-0bc54fdb87e4",
  "app_guid": "04ca2fa0-66a8-4a2d-b9f0-a06b26f512cc"
}

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "76d60ec2-a82f-4312-81b7-0bc54fdb87e4",
  "app_guid": "04ca2fa0-66a8-4a2d-b9f0-a06b26f512cc"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTY0IiwiZW1haWwiOiJlbWFpbC00NUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDI0NDcxNjg3fQ.E_WBWt7P4AiTfg7Y5PWTLLS1R-TgaGkMmrzbz84P5uA" \
	-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/9a6b41dd-b841-41d7-97e1-a1e00d6b60ef
X-VCAP-Request-ID: eba0fc52-5eb9-4a81-8496-dea9ce24d015
Content-Length: 701
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "9a6b41dd-b841-41d7-97e1-a1e00d6b60ef",
    "url": "/v2/service_bindings/9a6b41dd-b841-41d7-97e1-a1e00d6b60ef",
    "created_at": "2015-02-13T22:34:47Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "04ca2fa0-66a8-4a2d-b9f0-a06b26f512cc",
    "service_instance_guid": "76d60ec2-a82f-4312-81b7-0bc54fdb87e4",
    "credentials": {
      "creds-key-99": "creds-val-99"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/04ca2fa0-66a8-4a2d-b9f0-a06b26f512cc",
    "service_instance_url": "/v2/user_provided_service_instances/76d60ec2-a82f-4312-81b7-0bc54fdb87e4"
  }
}