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": "973fcc41-6d21-4d9b-8ca5-943701901b04",
  "app_guid": "04bfe327-def8-42b2-ba0a-e1a6389d7e75",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5IiwiZW1haWwiOiJlbWFpbC0yOUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDMyMzEzNjA1fQ.E9HtPdERG2g11m8tGSERsPggv_aArJhJSY_5DHi0n_A
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": "973fcc41-6d21-4d9b-8ca5-943701901b04",
  "app_guid": "04bfe327-def8-42b2-ba0a-e1a6389d7e75",
  "parameters": {
    "the_service_broker": "wants this object"
  }
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTI5IiwiZW1haWwiOiJlbWFpbC0yOUBzb21lZG9tYWluLmNvbSIsInNjb3BlIjpbImNsb3VkX2NvbnRyb2xsZXIuYWRtaW4iXSwiYXVkIjpbImNsb3VkX2NvbnRyb2xsZXIiXSwiZXhwIjoxNDMyMzEzNjA1fQ.E9HtPdERG2g11m8tGSERsPggv_aArJhJSY_5DHi0n_A" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "c30cde2b-4ed4-4377-8965-2237c166e40d",
    "url": "/v2/service_bindings/c30cde2b-4ed4-4377-8965-2237c166e40d",
    "created_at": "2015-05-15T16:53:24Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "04bfe327-def8-42b2-ba0a-e1a6389d7e75",
    "service_instance_guid": "973fcc41-6d21-4d9b-8ca5-943701901b04",
    "credentials": {
      "creds-key-71": "creds-val-71"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/04bfe327-def8-42b2-ba0a-e1a6389d7e75",
    "service_instance_url": "/v2/user_provided_service_instances/973fcc41-6d21-4d9b-8ca5-943701901b04"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/c30cde2b-4ed4-4377-8965-2237c166e40d
X-VCAP-Request-ID: 129306ee-64d5-4389-b525-3fb9c7e4b493
Content-Length: 701
X-Content-Type-Options: nosniff