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
{
  "service_instance_guid": "39857acb-b291-452b-98c4-696348d899ea",
  "app_guid": "dad6df72-b10d-4edf-ae3c-20fd27eefa97"
}

Headers

Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMiIsImVtYWlsIjoiZW1haWwtMjI0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjU5NDg2NzN9.7l-UH3k3wJ20JzGFjOAXhYoFwz8r-dryIgVUwJmq0pM
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": "39857acb-b291-452b-98c4-696348d899ea",
  "app_guid": "dad6df72-b10d-4edf-ae3c-20fd27eefa97"
}' -X POST \
	-H "Authorization: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoidWFhLWlkLTMyMiIsImVtYWlsIjoiZW1haWwtMjI0QHNvbWVkb21haW4uY29tIiwic2NvcGUiOlsiY2xvdWRfY29udHJvbGxlci5hZG1pbiJdLCJhdWQiOlsiY2xvdWRfY29udHJvbGxlciJdLCJleHAiOjE0MjU5NDg2NzN9.7l-UH3k3wJ20JzGFjOAXhYoFwz8r-dryIgVUwJmq0pM" \
	-H "Host: example.org" \
	-H "Content-Type: application/x-www-form-urlencoded" \
	-H "Cookie: "

Response

Status

201 Created

Body

{
  "metadata": {
    "guid": "822bff80-c357-42ca-b5b1-9286b4089116",
    "url": "/v2/service_bindings/822bff80-c357-42ca-b5b1-9286b4089116",
    "created_at": "2015-03-03T00:51:13Z",
    "updated_at": null
  },
  "entity": {
    "app_guid": "dad6df72-b10d-4edf-ae3c-20fd27eefa97",
    "service_instance_guid": "39857acb-b291-452b-98c4-696348d899ea",
    "credentials": {
      "creds-key-487": "creds-val-487"
    },
    "binding_options": {

    },
    "gateway_data": null,
    "gateway_name": "",
    "syslog_drain_url": null,
    "app_url": "/v2/apps/dad6df72-b10d-4edf-ae3c-20fd27eefa97",
    "service_instance_url": "/v2/user_provided_service_instances/39857acb-b291-452b-98c4-696348d899ea"
  }
}

Headers

Content-Type: application/json;charset=utf-8
Location: /v2/service_bindings/822bff80-c357-42ca-b5b1-9286b4089116
X-VCAP-Request-ID: 6a1c5777-223d-4872-b596-194eb8452f24
Content-Length: 703
X-Content-Type-Options: nosniff