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": "7db2c714-d806-493e-acd4-6ba48cb7af83",
  "app_guid": "2324134a-8412-441e-9e14-a55905f2bf93",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk3IiwiZW1haWwiOiJlbWFpbC02MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYxMzc0NjI2fQ.RntzHdmzX05Ty4y3mkFLcqs4TczFuA0z4MweQr54eFI
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": "7db2c714-d806-493e-acd4-6ba48cb7af83",
  "app_guid": "2324134a-8412-441e-9e14-a55905f2bf93",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTk3IiwiZW1haWwiOiJlbWFpbC02MUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDYxMzc0NjI2fQ.RntzHdmzX05Ty4y3mkFLcqs4TczFuA0z4MweQr54eFI" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "5bf1fcb9-e879-45e4-af0e-021365817a63",
    "url": "/v2/service_bindings/5bf1fcb9-e879-45e4-af0e-021365817a63",
    "created_at": "2016-04-16T01:23:46Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "2324134a-8412-441e-9e14-a55905f2bf93",
    "service_instance_guid": "7db2c714-d806-493e-acd4-6ba48cb7af83",
    "credentials": {
      "creds-key-7": "creds-val-7"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/2324134a-8412-441e-9e14-a55905f2bf93",
    "service_instance_url": "/v2/user_provided_service_instances/7db2c714-d806-493e-acd4-6ba48cb7af83"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/5bf1fcb9-e879-45e4-af0e-021365817a63
X-VCAP-Request-ID: 0790a289-5d47-4873-81b4-062b690b87f3
Content-Length: 699
X-Content-Type-Options: nosniff