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": "9e704f75-9e33-4e04-a146-fadd1b3213f2",
  "app_guid": "b0d64714-bc05-4992-b597-3c9f53797fb5",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTUwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzE2NDY2MzZ9.cyti4wsBcRaWC-f3FI-X31x1RZjt0FDmdswMEQau1Is
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": "9e704f75-9e33-4e04-a146-fadd1b3213f2",
  "app_guid": "b0d64714-bc05-4992-b597-3c9f53797fb5",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTIyMiIsImVtYWlsIjoiZW1haWwtMTUwQHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MzE2NDY2MzZ9.cyti4wsBcRaWC-f3FI-X31x1RZjt0FDmdswMEQau1Is" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "effdf1aa-c3f7-4f32-9d01-5f0eb299a200",
    "url": "/v2/service_bindings/effdf1aa-c3f7-4f32-9d01-5f0eb299a200",
    "created_at": "2015-05-07T23:37:16Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "b0d64714-bc05-4992-b597-3c9f53797fb5",
    "service_instance_guid": "9e704f75-9e33-4e04-a146-fadd1b3213f2",
    "credentials": {
      "creds-key-331": "creds-val-331"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/b0d64714-bc05-4992-b597-3c9f53797fb5",
    "service_instance_url": "/v2/user_provided_service_instances/9e704f75-9e33-4e04-a146-fadd1b3213f2"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/effdf1aa-c3f7-4f32-9d01-5f0eb299a200
X-VCAP-Request-ID: 2c50677d-b006-48d5-ae86-65b264879830
Content-Length: 703
X-Content-Type-Options: nosniff