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

Route

POST /v2/service_bindings

Body

{
  "service_instance_guid": "bdba4390-01b1-4ab6-87a0-243710dc3104",
  "app_guid": "5cc5422d-7605-4e7e-a2fc-00434af8d344"
}

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "bdba4390-01b1-4ab6-87a0-243710dc3104",
  "app_guid": "5cc5422d-7605-4e7e-a2fc-00434af8d344"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTcyIiwiZW1haWwiOiJlbWFpbC02NUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDE3NDYyMzU1fQ.oeJI-AQDJqTozsimRuJKKQZHTiSNLT6ug6v4ifMn76U" \
	-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/0b9a77ad-a0e1-47bd-ac0f-fbe8f151e503
X-VCAP-Request-ID: f67f3fea-98e0-4e82-b36a-53ed08e27acd
Content-Length: 708
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "0b9a77ad-a0e1-47bd-ac0f-fbe8f151e503",
    "url": "/v2/service_bindings/0b9a77ad-a0e1-47bd-ac0f-fbe8f151e503",
    "created_at": "2014-11-24T19:32:35+00:00",
    "updated_at": null
  },
  "entity": {
    "app_guid": "5cc5422d-7605-4e7e-a2fc-00434af8d344",
    "service_instance_guid": "bdba4390-01b1-4ab6-87a0-243710dc3104",
    "credentials": {
      "creds-key-157": "creds-val-157"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/5cc5422d-7605-4e7e-a2fc-00434af8d344",
    "service_instance_url": "/v2/user_provided_service_instances/bdba4390-01b1-4ab6-87a0-243710dc3104"
  }
}