doc/pacts/markdown/Pact Broker Client - Pact Broker.md in pact_broker-client-1.14.1 vs doc/pacts/markdown/Pact Broker Client - Pact Broker.md in pact_broker-client-1.15.0

- old
+ new

@@ -18,10 +18,12 @@ * [A request for the compatibility matrix where one or more versions does not exist](#a_request_for_the_compatibility_matrix_where_one_or_more_versions_does_not_exist_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 * [A request for the compatibility matrix where only the version of Foo is specified](#a_request_for_the_compatibility_matrix_where_only_the_version_of_Foo_is_specified_given_the_pact_for_Foo_version_1.2.3_has_been_verified_by_Bar_version_4.5.6_and_version_5.6.7) given the pact for Foo version 1.2.3 has been verified by Bar version 4.5.6 and version 5.6.7 +* [A request for the index resource](#a_request_for_the_index_resource) + * [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:latest-tagged-version_relation_exists_in_the_index_resource) given the pb:latest-tagged-version relation exists in the index resource * [A request for the index resource](#a_request_for_the_index_resource_given_the_pb:latest-version_relation_exists_in_the_index_resource) given the pb:latest-version relation exists in the index resource * [A request for the list of the latest pacts from all consumers for the Pricing Service'](#a_request_for_the_list_of_the_latest_pacts_from_all_consumers_for_the_Pricing_Service&#39;_given_a_latest_pact_between_Condor_and_the_Pricing_Service_exists) given a latest pact between Condor and the Pricing Service exists @@ -30,10 +32,24 @@ * [A request for the successful rows of the compatibility matrix for all versions of Foo and Bar](#a_request_for_the_successful_rows_of_the_compatibility_matrix_for_all_versions_of_Foo_and_Bar_given_the_pact_for_Foo_version_1.2.3_has_been_successfully_verified_by_Bar_version_4.5.6,_and_1.2.4_unsuccessfully_by_9.9.9) given the pact for Foo version 1.2.3 has been successfully verified by Bar version 4.5.6, and 1.2.4 unsuccessfully by 9.9.9 * [A request retrieve a pact for a specific version](#a_request_retrieve_a_pact_for_a_specific_version_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0) given the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0 +* [A request to create a global webhook with a JSON body](#a_request_to_create_a_global_webhook_with_a_JSON_body) + +* [A request to create a webhook for a consumer and provider](#a_request_to_create_a_webhook_for_a_consumer_and_provider_given_&#39;Condor&#39;_does_not_exist_in_the_pact-broker) given 'Condor' does not exist in the pact-broker + +* [A request to create a webhook with a JSON body for a consumer](#a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker + +* [A request to create a webhook with a JSON body for a consumer and provider](#a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker + +* [A request to create a webhook with a JSON body for a consumer that does not exist](#a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_that_does_not_exist) + +* [A request to create a webhook with a JSON body for a provider](#a_request_to_create_a_webhook_with_a_JSON_body_for_a_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker + +* [A request to create a webhook with a non-JSON body for a consumer and provider](#a_request_to_create_a_webhook_with_a_non-JSON_body_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker + * [A request to get the Pricing Service](#a_request_to_get_the_Pricing_Service_given_the_&#39;Pricing_Service&#39;_already_exists_in_the_pact-broker) given the 'Pricing Service' already exists in the pact-broker * [A request to get the Pricing Service](#a_request_to_get_the_Pricing_Service_given_the_&#39;Pricing_Service&#39;_does_not_exist_in_the_pact-broker) given the 'Pricing Service' does not exist in the pact-broker * [A request to list pacticipants](#a_request_to_list_pacticipants_given_&#39;Condor&#39;_exists_in_the_pact-broker) given 'Condor' exists in the pact-broker @@ -68,10 +84,12 @@ * [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_&#39;Condor&#39;_does_not_exist_in_the_pact-broker) given 'Condor' does not exist in the pact-broker * [A request to tag the production version of Condor](#a_request_to_tag_the_production_version_of_Condor_given_&#39;Condor&#39;_exists_in_the_pact-broker) given 'Condor' exists in the pact-broker +* [An invalid request to create a webhook for a consumer and provider](#an_invalid_request_to_create_a_webhook_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker) given the 'Pricing Service' and 'Condor' already exist in the pact-broker + #### Interactions <a name="a_request_for_the_compatibility_matrix_for_a_pacticipant_that_does_not_exist"></a> Upon receiving **a request for the compatibility matrix for a pacticipant that does not exist** from Pact Broker Client, with ```json @@ -83,10 +101,13 @@ ``` Pact Broker will respond with: ```json { "status": 400, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "errors": [ "an error message" ] } @@ -103,10 +124,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "matrix": [ { "consumer": { "name": "Foo", @@ -164,10 +188,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -208,10 +235,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -252,10 +282,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -296,10 +329,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "matrix": [ { "consumer": { "name": "Foo", @@ -329,10 +365,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -373,10 +412,13 @@ ``` Pact Broker will respond with: ```json { "status": 400, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "errors": [ "an error message" ] } @@ -393,10 +435,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -424,25 +469,55 @@ } ] } } ``` +<a name="a_request_for_the_index_resource"></a> +Upon receiving **a request for the index resource** from Pact Broker Client, with +```json +{ + "method": "get", + "path": "/", + "headers": { + "Accept": "application/hal+json" + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "pb:webhooks": { + "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-PB-WEBHOOKS" + } + } + } +} +``` <a name="a_request_for_the_index_resource_given_the_pb:latest-tagged-version_relation_exists_in_the_index_resource"></a> Given **the pb:latest-tagged-version relation exists in the index resource**, upon receiving **a request for the index resource** from Pact Broker Client, with ```json { "method": "get", "path": "/", "headers": { - "Accept": "application/json, application/hal+json" + "Accept": "application/hal+json, application/json" } } ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-tagged-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-{pacticipant}-{tag}" } @@ -455,18 +530,21 @@ ```json { "method": "get", "path": "/", "headers": { - "Accept": "application/json, application/hal+json" + "Accept": "application/hal+json, application/json" } } ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-version": { "href": "http://localhost:1234/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-{pacticipant}" } @@ -490,11 +568,11 @@ "_links": { "provider": { "href": "http://example.org/pacticipants/Pricing%20Service", "title": "Pricing Service" }, - "pacts": [ + "pb:pacts": [ { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "title": "Pact between Condor (v1.3.0) and Pricing Service", "name": "Condor" } @@ -519,11 +597,11 @@ "_links": { "provider": { "href": "http://example.org/pacticipants/Pricing%20Service", "title": "Pricing Service" }, - "pacts": [ + "pb:pacts": [ { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/version/1.3.0", "title": "Pact between Condor (v1.3.0) and Pricing Service", "name": "Condor" } @@ -543,10 +621,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "summary": { "deployable": true, "reason": "some text" }, @@ -586,10 +667,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "consumer": { "name": "Condor" }, "provider": { @@ -599,10 +683,351 @@ ] } } ``` +<a name="a_request_to_create_a_global_webhook_with_a_JSON_body"></a> +Upon receiving **a request to create a global webhook with a JSON body** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "self": { + "href": "http://localhost:1234/some-url", + "title": "A title" + } + } + } +} +``` +<a name="a_request_to_create_a_webhook_for_a_consumer_and_provider_given_&#39;Condor&#39;_does_not_exist_in_the_pact-broker"></a> +Given **'Condor' does not exist in the pact-broker**, upon receiving **a request to create a webhook for a consumer and provider** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 404, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + } +} +``` +<a name="a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a> +Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **a request to create a webhook with a JSON body for a consumer** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + }, + "consumer": { + "name": "Condor" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "self": { + "href": "http://localhost:1234/some-url", + "title": "A title" + } + } + } +} +``` +<a name="a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a> +Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **a request to create a webhook with a JSON body for a consumer and provider** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "self": { + "href": "http://localhost:1234/some-url", + "title": "A title" + } + } + } +} +``` +<a name="a_request_to_create_a_webhook_with_a_JSON_body_for_a_consumer_that_does_not_exist"></a> +Upon receiving **a request to create a webhook with a JSON body for a consumer that does not exist** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + }, + "consumer": { + "name": "Condor" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 400, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "errors": { + "consumer.name": [ + "Some error" + ] + } + } +} +``` +<a name="a_request_to_create_a_webhook_with_a_JSON_body_for_a_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a> +Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **a request to create a webhook with a JSON body for a provider** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/HAL-REL-PLACEHOLDER-PB-WEBHOOKS", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + }, + "provider": { + "name": "Pricing Service" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "self": { + "href": "http://localhost:1234/some-url", + "title": "A title" + } + } + } +} +``` +<a name="a_request_to_create_a_webhook_with_a_non-JSON_body_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a> +Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **a request to create a webhook with a non-JSON body for a consumer and provider** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": "https://webhook", + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": "<xml></xml>", + "username": "username", + "password": "password" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "_links": { + "self": { + "href": "http://localhost:1234/some-url", + "title": "A title" + } + } + } +} +``` <a name="a_request_to_get_the_Pricing_Service_given_the_&#39;Pricing_Service&#39;_already_exists_in_the_pact-broker"></a> Given **the 'Pricing Service' already exists in the pact-broker**, upon receiving **a request to get the Pricing Service** from Pact Broker Client, with ```json { "method": "get", @@ -789,10 +1214,13 @@ ``` Pact Broker will respond with: ```json { "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } @@ -824,10 +1252,13 @@ ``` Pact Broker will respond with: ```json { "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } @@ -863,11 +1294,13 @@ "status": 500, "headers": { "Content-Type": "application/hal+json" }, "body": { - "message": "An error occurred" + "error": { + "message": "An error occurred" + } } } ``` <a name="a_request_to_publish_a_pact_with_method_patch_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker,_and_Condor_already_has_a_pact_published_for_version_1.3.0"></a> Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker, and Condor already has a pact published for version 1.3.0**, upon receiving **a request to publish a pact with method patch** from Pact Broker Client, with @@ -893,10 +1326,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } @@ -928,10 +1364,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "pb:latest-pact-version": { "href": "http://example.org/pacts/provider/Pricing%20Service/consumer/Condor/latest" } @@ -954,11 +1393,14 @@ } ``` Pact Broker will respond with: ```json { - "status": 200 + "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + } } ``` <a name="a_request_to_register_the_repository_URL_of_a_pacticipant_given_the_&#39;Pricing_Service&#39;_does_not_exist_in_the_pact-broker"></a> Given **the 'Pricing Service' does not exist in the pact-broker**, upon receiving **a request to register the repository URL of a pacticipant** from Pact Broker Client, with ```json @@ -974,28 +1416,34 @@ } ``` Pact Broker will respond with: ```json { - "status": 201 + "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + } } ``` <a name="a_request_to_retrieve_the_latest_&#39;production&#39;_version_of_Condor_given_&#39;Condor&#39;_exists_in_the_pact-broker_with_the_latest_tagged_&#39;production&#39;_version_1.2.3"></a> Given **'Condor' exists in the pact-broker with the latest tagged 'production' version 1.2.3**, upon receiving **a request to retrieve the latest 'production' version of Condor** from Pact Broker Client, with ```json { "method": "get", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-TAGGED-VERSION-Condor-production", "headers": { - "Accept": "application/json, application/hal+json" + "Accept": "application/hal+json, application/json" } } ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "number": "1.2.3", "_links": { "self": { "href": "http://localhost:1234/some-url" @@ -1052,18 +1500,21 @@ ```json { "method": "get", "path": "/HAL-REL-PLACEHOLDER-INDEX-PB-LATEST-VERSION-Condor", "headers": { - "Accept": "application/json, application/hal+json" + "Accept": "application/hal+json, application/json" } } ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "number": "1.2.3", "_links": { "self": { "href": "http://localhost:1234/some-url" @@ -1077,18 +1528,21 @@ ```json { "method": "get", "path": "/pacts/provider/Pricing%20Service/consumer/Condor/latest/prod", "headers": { - "Accept": "application/json, application/hal+json" + "Accept": "application/hal+json, application/json" } } ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "consumer": { "name": "Condor" }, "provider": { @@ -1113,10 +1567,13 @@ ``` Pact Broker will respond with: ```json { "status": 200, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } @@ -1137,10 +1594,13 @@ ``` Pact Broker will respond with: ```json { "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } @@ -1161,14 +1621,65 @@ ``` Pact Broker will respond with: ```json { "status": 201, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, "body": { "_links": { "self": { "href": "http://localhost:1234/pacticipants/Condor/versions/1.3.0/tags/prod" } + } + } +} +``` +<a name="an_invalid_request_to_create_a_webhook_for_a_consumer_and_provider_given_the_&#39;Pricing_Service&#39;_and_&#39;Condor&#39;_already_exist_in_the_pact-broker"></a> +Given **the 'Pricing Service' and 'Condor' already exist in the pact-broker**, upon receiving **an invalid request to create a webhook for a consumer and provider** from Pact Broker Client, with +```json +{ + "method": "post", + "path": "/webhooks/provider/Pricing%20Service/consumer/Condor", + "headers": { + "Content-Type": "application/json", + "Accept": "application/hal+json" + }, + "body": { + "events": [ + { + "name": "contract_content_changed" + } + ], + "request": { + "url": null, + "method": "POST", + "headers": { + "Foo": "bar", + "Bar": "foo" + }, + "body": { + "some": "body" + }, + "username": "username", + "password": "password" + } + } +} +``` +Pact Broker will respond with: +```json +{ + "status": 400, + "headers": { + "Content-Type": "application/hal+json;charset=utf-8" + }, + "body": { + "errors": { + "request.url": [ + "Some error" + ] } } } ```