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

Route

POST /v2/service_bindings

Body

{
  "service_instance_guid": "f1bbed68-c778-4d74-a3ac-82c42bcfd8f2",
  "app_guid": "b329a1fc-ae16-4265-b10c-fb5aed159acc"
}

cURL

curl "https://api.[your-domain.com]/v2/service_bindings" -d '{
  "service_instance_guid": "f1bbed68-c778-4d74-a3ac-82c42bcfd8f2",
  "app_guid": "b329a1fc-ae16-4265-b10c-fb5aed159acc"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTEwMCIsImVtYWlsIjoiZW1haWwtNzFAc29tZWRvbWFpbi5jb20iLCJzY29wZSI6WyJjbG91ZF9jb250cm9sbGVyLmFkbWluIl0sImF1ZCI6WyJjbG91ZF9jb250cm9sbGVyIl0sImV4cCI6MTQxNTc1NDEzNH0.qWgu5DTc-AnW2FqCfHgkq2td9g6Q0gMhqGM9CglHPmM" \
	-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/0156bbf3-f402-423f-9909-b0eb2b1390ba
X-VCAP-Request-ID: a0d76ccb-6f30-4f36-87cb-c7ee442cdd28
Content-Length: 708
X-Content-Type-Options: nosniff

Status

201 Created

Body

{
  "metadata": {
    "guid": "0156bbf3-f402-423f-9909-b0eb2b1390ba",
    "url": "/v2/service_bindings/0156bbf3-f402-423f-9909-b0eb2b1390ba",
    "created_at": "2014-11-05T01:02:14+00:00",
    "updated_at": null
  },
  "entity": {
    "app_guid": "b329a1fc-ae16-4265-b10c-fb5aed159acc",
    "service_instance_guid": "f1bbed68-c778-4d74-a3ac-82c42bcfd8f2",
    "credentials": {
      "creds-key-154": "creds-val-154"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/b329a1fc-ae16-4265-b10c-fb5aed159acc",
    "service_instance_url": "/v2/user_provided_service_instances/f1bbed68-c778-4d74-a3ac-82c42bcfd8f2"
  }
}