From ebb44df3141015fa8bc61b434d97d00989617ba4 Mon Sep 17 00:00:00 2001 From: itch Date: Thu, 7 Nov 2024 15:33:05 +0100 Subject: [PATCH 1/4] PS-2939 mark GPW report_name, white_label_profile_id and NAP fields as deperacted --- source/includes/_gpw.md | 44 ++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/source/includes/_gpw.md b/source/includes/_gpw.md index 7224007ef99..7c73901e38e 100644 --- a/source/includes/_gpw.md +++ b/source/includes/_gpw.md @@ -125,22 +125,22 @@ Parameter | Notes api-key | Required sig | Required [See above for how to generate signature and expires values.](#authentication) expires | Required [See above for how to generate signature and expires values.](#authentication) -report_name | Required +report_name | Deprecated, please use Location for update this field. location_id | Required Associate this report with a location in your account. This ID needs to correspond to a valid location in your account. -white_label_profile_id | Assign a white label profile to this report. The ID needs to correspond to a valid white label profile in your account. -business_names | Required Supply one business name. For example, Greens Restaurant. +white_label_profile_id | Deprecated, please use Location for update this field. +business_names | Deprecated, please use Location for update this field. schedule | Required One of Adhoc or Monthly day_of_month | Required One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1 (last day of month). report_type | Required One of with or without. 'with' - the business has a Google Local profile. 'without' - Ignore this business, just display competitor information. Defaults to with. -address1 | Required 80 characters max. Optional for report_type=without -address2 | 80 characters max. -city | Required Optional for report_type=without -state_code | Required (USA, CAN:EN and AUS) -google_location | Required A valid google search location. Please refer to our location check method. +address1 | Deprecated, please use Location for update this field. +address2 | Deprecated, please use Location for update this field. +city | Deprecated, please use Location for update this field. +state_code | Deprecated, please use Location for update this field. +google_location | Deprecated, please use Location for update this field. is_public | Determines whether or not to make the report available on a public URL you can give to your customers. One of Yes or No. Defaults to No. -postcode | Required A valid postcode or ZIP. 80 characters max. Optional for report_type=without -phone_number | Required Optional for report_type=without -country | Required One of USA, CAN:EN, GBR or AUS. +postcode | Deprecated, please use Location for update this field. +phone_number | Deprecated, please use Location for update this field. +country | Deprecated, please use Location for update this field. search_terms | Required Supply one or more search terms (max 5) as a JSON string. For example, ["restaurant san francisco","cafe san francisco"]. notify | One of Yes or No. If set to yes we will send report alerts to all email addresses specified (see field below). If you include customer email addresses when setting up your report we'll also email them the alerts so please be sure this is what you want before adding their addresses. Default is No. email_addresses | Supply one or more (max 5) email addresses for us to send report alerts to. This only takes effect if notify is set to Yes. JSON string. For example, ["email1@test.com","email2@test.com"]. @@ -228,24 +228,24 @@ api-key | Required sig | Required [See above for how to generate signature and expires values.](#authentication) expires | Required [See above for how to generate signature and expires values.](#authentication) report-ID | Required -report_name | +report_name | Deprecated, please use Location for update this field. location_id | Required Associate this report with a location in your account. This ID needs to correspond to a valid location in your account. -white_label_profile_id | Assign a white label profile to this report. The ID needs to correspond to a valid white label profile in your account. -business_names | Supply one business name. For example, Greens Restaurant. +white_label_profile_id | Deprecated, please use Location for update this field. +business_names | Deprecated, please use Location for update this field. schedule | One of Adhoc or Monthly day_of_month | One of 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, -1 (last day of month). report_type | One of with or without. 'with' - the business has a Google Local profile. 'without' - Ignore this business, just display competitor information. Defaults to with. -address1 | 80 characters max. -address2 | 80 characters max. -city | -state_code | (USA, CAN:EN and AUS) -postcode | A valid postcode or ZIP. 80 characters max. -phone_number | -country | One of USA, CAN:EN, GBR or AUS. +address1 | Deprecated, please use Location for update this field. +address2 | Deprecated, please use Location for update this field. +city | Deprecated, please use Location for update this field. +state_code | Deprecated, please use Location for update this field. +postcode | Deprecated, please use Location for update this field. +phone_number | Deprecated, please use Location for update this field. +country | Deprecated, please use Location for update this field. search_terms | Supply one or more search terms (max 5) as a JSON string. For example, ["restaurant san francisco","cafe san francisco"]. notify | One of Yes or No. If set to yes we will send report alerts to all email addresses specified (see field below). If you include customer email addresses when setting up your report we'll also email them the alerts so please be sure this is what you want before adding their addresses. Default is No. email_addresses | Supply one or more (max 5) email addresses for us to send report alerts to. This only takes effect if notify is set to Yes. JSON string. For example, ["email1@test.com","email2@test.com"]. -google_location | A valid google search location. Please refer to our location check method. +google_location | Deprecated, please use Location for update this field. is_public | Determines whether or not to make the report available on a public URL you can give to your customers. One of Yes or No. Defaults to No. run | One of Yes or No. Runs the report after adding. Defaults to Yes. From 61e16a8c23f6f754fdb6a8533b8ca10a30a5446c Mon Sep 17 00:00:00 2001 From: itch Date: Fri, 8 Nov 2024 11:51:34 +0100 Subject: [PATCH 2/4] PS-2939 revert google_location docs --- source/includes/_gpw.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/includes/_gpw.md b/source/includes/_gpw.md index 7c73901e38e..83a6e188f20 100644 --- a/source/includes/_gpw.md +++ b/source/includes/_gpw.md @@ -136,7 +136,7 @@ address1 | Deprecated, please use Location for update this field. address2 | Deprecated, please use Location for update this field. city | Deprecated, please use Location for update this field. state_code | Deprecated, please use Location for update this field. -google_location | Deprecated, please use Location for update this field. +google_location | Required A valid google search location. Please refer to our location check method. is_public | Determines whether or not to make the report available on a public URL you can give to your customers. One of Yes or No. Defaults to No. postcode | Deprecated, please use Location for update this field. phone_number | Deprecated, please use Location for update this field. @@ -245,7 +245,7 @@ country | Deprecated, please use Location for update this field. search_terms | Supply one or more search terms (max 5) as a JSON string. For example, ["restaurant san francisco","cafe san francisco"]. notify | One of Yes or No. If set to yes we will send report alerts to all email addresses specified (see field below). If you include customer email addresses when setting up your report we'll also email them the alerts so please be sure this is what you want before adding their addresses. Default is No. email_addresses | Supply one or more (max 5) email addresses for us to send report alerts to. This only takes effect if notify is set to Yes. JSON string. For example, ["email1@test.com","email2@test.com"]. -google_location | Deprecated, please use Location for update this field. +google_location | Required A valid google search location. Please refer to our location check method. is_public | Determines whether or not to make the report available on a public URL you can give to your customers. One of Yes or No. Defaults to No. run | One of Yes or No. Runs the report after adding. Defaults to Yes. From 16080c36b3e08e657c0793d4cdbf680f631812da Mon Sep 17 00:00:00 2001 From: itch Date: Fri, 8 Nov 2024 12:35:48 +0100 Subject: [PATCH 3/4] PS-2939 revert google_location docs --- source/includes/_gpw.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/_gpw.md b/source/includes/_gpw.md index 83a6e188f20..190e172d638 100644 --- a/source/includes/_gpw.md +++ b/source/includes/_gpw.md @@ -245,7 +245,7 @@ country | Deprecated, please use Location for update this field. search_terms | Supply one or more search terms (max 5) as a JSON string. For example, ["restaurant san francisco","cafe san francisco"]. notify | One of Yes or No. If set to yes we will send report alerts to all email addresses specified (see field below). If you include customer email addresses when setting up your report we'll also email them the alerts so please be sure this is what you want before adding their addresses. Default is No. email_addresses | Supply one or more (max 5) email addresses for us to send report alerts to. This only takes effect if notify is set to Yes. JSON string. For example, ["email1@test.com","email2@test.com"]. -google_location | Required A valid google search location. Please refer to our location check method. +google_location | A valid google search location. Please refer to our location check method. is_public | Determines whether or not to make the report available on a public URL you can give to your customers. One of Yes or No. Defaults to No. run | One of Yes or No. Runs the report after adding. Defaults to Yes. From 2bdd764a0130c7c700171666dc02f3db78ac18d9 Mon Sep 17 00:00:00 2001 From: itch Date: Mon, 11 Nov 2024 08:54:36 +0100 Subject: [PATCH 4/4] PS-2939 cleanup deprecated fields in documentation --- source/includes/_gpw.md | 45 +++-------------------------------------- 1 file changed, 3 insertions(+), 42 deletions(-) diff --git a/source/includes/_gpw.md b/source/includes/_gpw.md index 190e172d638..c751d5b1785 100644 --- a/source/includes/_gpw.md +++ b/source/includes/_gpw.md @@ -15,19 +15,10 @@ use BrightLocal\Api; $api = new Api('', ''); $response = $api->post('/v4/gpw/add', [ 'location_id' => 1, - 'report_name' => 'Le Bernardin', - 'business_names' => 'Le Bernardin', 'schedule' => 'Adhoc', 'day_of_month' => '2', 'report_type' => 'with', - 'address1' => '155 West 51st Street', - 'address2' => '', - 'city' => 'New York', - 'state_code' => 'NY', 'google_location' => 'New York, NY', - 'postcode' => '10019', - 'phone_number' => '+1 212-554-1515', - 'country' => 'USA', 'search_terms' => '["restaurant manhattan","cafe new york"]' ]); print_r($response->getResult()); @@ -39,18 +30,9 @@ curl -X POST \ -d 'sig=' \ -d 'expires=' \ -d 'location_id=1' \ - -d 'report_name=Le Bernardin' \ - -d 'business_names=Le Bernardin' \ -d 'schedule=Adhoc' \ -d 'day_of_month=2' \ -d 'report_type=with' \ - -d 'address1=155 West 51st Street' \ - -d 'address2=' \ - -d 'city=New York' \ - -d 'state_code=NY' \ - -d 'postcode=10019' \ - -d 'phone_number=+1 212-554-151' \ - -d 'country=USA' \ -d 'search_terms=["restaurant manhattan","cafe new york"]' https://tools.brightlocal.com/seo-tools/api/v4/gpw/add ``` @@ -60,19 +42,10 @@ Api api = new Api(apiKey, apiSecret); Parameters parameters = new Parameters { { "location_id", 1 }, - { "report_name", "Le Bernardin" }, - { "business_names", "Le Bernardin" }, { "schedule", "Adhoc" }, { "day_of_month", "2" }, { "report_type", "with" }, - { "address1", "155 West 51st Street" }, - { "address2", "" }, - { "city", "New York" }, - { "state_code", "NY" }, { "google_location", "New York, NY" }, - { "postcode", "10019" }, - { "phone_number", "+1 212-554-1515" }, - { "country", "USA" }, { "search_terms", new List { "restaurant manhattan", "cafe new york" } }, }; Response response = api.Post("/v4/gpw/add", parameters); @@ -96,18 +69,10 @@ Console.WriteLine(response.GetContent()); "success": false, "errors": { "run": "You don\'t have any credits left", - "business_names": "Please enter one business name", "report_type": "Report type is not available", - "phone_number": "Please enter a telephone number", - "postcode": "Please enter a postcode", - "address1": "Please enter an address", - "city": "Please enter a city", "search_terms": "Please enter at least one search term", - "country": "Please choose country from the list", - "report_name": "Please enter a report name", "google_location": "The location was not recognized. Please enter a correct location", - "schedule": "Please select schedule", - "white_label_profile_id": "Such White Label Profile doesn't exists" + "schedule": "Please select schedule" } } ``` @@ -162,8 +127,7 @@ $reportId = 1; $api = new Api('', ''); $response = $api->put('/v4/gpw/' . $reportId, [ 'location-id' => 1, - 'business-name' => 'Le Bernardin', - 'contact-telephone' => '+1 212-554-1515' + 'schedule' => 'Adhoc' ]); print_r($response->getResult()); ``` @@ -174,8 +138,6 @@ curl -X PUT \ -d 'sig=' \ -d 'expires=' \ -d 'location_id=1' \ - -d 'report_name=Le Bernardin' \ - -d 'business_names=Le Bernardin' \ -d 'schedule=Adhoc' \ -d 'day_of_month=2' \ https://tools.brightlocal.com/seo-tools/api/v4/gpw/1 @@ -188,8 +150,7 @@ Parameters parameters = new Parameters { { "location-id", 1 }, - { "business-names", "Le Bernardin" }, - { "contact-telephone", "+1 212-554-1515" }, + { "schedule", "Adhoc" }, }; Response response = api.Put("/v4/gpw/"+ reportId, parameters);