/api/v4/locations/updateBir konumu güncelleyin
Mevcut bir konumun yazılabilir alanlarını günceller. Yalnızca gönderdiğiniz alanlar değiştirilir.
Parametreler
Gövde
Zorunlu olarak işaretlenen iç içe bir alan yalnızca üst alanını gönderdiğinizde geçerlidir. Üst alan isteğe bağlıysa ve onu göndermezseniz, zorunlu alt alanları da geçerli olmaz.
| Ad | Tür | Zorunlu | Açıklama |
|---|---|---|---|
| input.id | string | zorunlu | The location's Base64-encoded Relay ID to update. |
| input.name | string | isteğe bağlı | Business name. |
| input.street | string | isteğe bağlı | Street address. |
| input.city | string | isteğe bağlı | City. |
| input.stateIso | string | isteğe bağlı | State/region ISO code. |
| input.postalCode | string | isteğe bağlı | Postal or ZIP code. |
| input.countryIso | string | isteğe bağlı | Two-letter country ISO code. |
| input.phone | string | isteğe bağlı | Primary phone number. |
| input.bizUrl | string | isteğe bağlı | Business website URL. Published to directories as the location's website. |
| input.primaryGbpSiteCategoryId | string | isteğe bağlı | Primary Google Business Profile category, as a GCID (e.g. `gcid:restaurant`). Resolved against `countryIso`, so send the two together. |
| input.additionalGbpSiteCategoryIds | array of strings | isteğe bağlı | Additional Google Business Profile categories, as GCIDs. Also resolved against `countryIso`. |
| input.offeringsUrl | string | isteğe bağlı | URL of the menu, catalogue, or service list. |
| input.bookingUrl | string | isteğe bağlı | URL customers use to book an appointment. |
| input.reservationUrl | string | isteğe bağlı | URL customers use to make a reservation. |
| input.street1 | string | isteğe bağlı | Second address line (suite, unit, floor). |
| input.latitude | string | isteğe bağlı | Latitude of the location, as a string. Send with `longitude`; publishers use it when the address alone is ambiguous. |
| input.longitude | string | isteğe bağlı | Longitude of the location, as a string. Send with `latitude`. |
| input.ownerEmail | string | isteğe bağlı | Email of the location owner. Used for listing claims and verification, not for login. |
| input.ownerName | string | isteğe bağlı | Name of the location owner. |
| input.facebookUrl | string | isteğe bağlı | URL of the location's Facebook page. |
| input.twitterUrl | string | isteğe bağlı | URL of the location's X (Twitter) profile. |
| input.linkedinUrl | string | isteğe bağlı | URL of the location's LinkedIn page. |
| input.instagramUrl | string | isteğe bağlı | URL of the location's Instagram profile. |
| input.youtubeUrl | string | isteğe bağlı | URL of the location's YouTube channel. |
| input.tiktokUrl | string | isteğe bağlı | URL of the location's TikTok profile. |
| input.pinterestUrl | string | isteğe bağlı | URL of the location's Pinterest profile. |
| input.tagline | string | isteğe bağlı | Short tagline for the business. |
| input.description | string | isteğe bağlı | Business description. Published to Google Business Profile as the business description. |
| input.yearOfIncorporation | string | isteğe bağlı | Year the business was incorporated, e.g. `2014`. |
| input.googleAdsPhone | string | isteğe bağlı | Alternate phone shown on Google Ads location extensions instead of `phone`. |
| input.additionalPhones | array of strings | isteğe bağlı | Secondary phone numbers submitted to Google Business Profile. |
| input.videos | array of strings | isteğe bağlı | Video URLs for the location. |
| input.additionalCategoryIds | array of integers | isteğe bağlı | Secondary Listings API subcategory IDs, from the subcategories endpoint. Distinct from `additionalGbpSiteCategoryIds`, which takes Google GCIDs. |
| input.subCategoryId | integer | isteğe bağlı | Primary subcategory ID. Pick a valid ID from the subcategories list endpoint. |
| input.storeId | string | isteğe bağlı | Unique store code. Must be unique across the account. |
| input.enabledSiteIds | array of integers | isteğe bağlı | Site IDs to publish this location to, when you want a subset of your plan's sites. See the plan-sites endpoint for valid IDs. Omit to publish to every site in your plan. |
| input.updateOnlySiteIds | array of integers | isteğe bağlı | Restrict this update to the given site IDs. Other sites keep their current published values. |
| input.contentPreferredLanguage | string | isteğe bağlı | Preferred language for the location's published content, e.g. `ENGLISH`. |
| input.submissionDisabledSiteIds | array of integers | isteğe bağlı | Site IDs to exclude from submission. The inverse of `enabledSiteIds`, useful when you want every site in your plan except a few. |
| input.hideAddress | boolean | isteğe bağlı | Set `true` for a service-area business. ListingsAPI stores the address you send but does not submit it to publishers. |
| input.temporarilyClosed | boolean | isteğe bağlı | Set `true` to stop publishing business hours while the location is temporarily closed. |
| input.serviceItems | array of objects | isteğe bağlı | Services offered, published to Google Business Profile. |
| input.paymentMethods | array of strings | isteğe bağlı | Payment methods accepted. One or more of `VISA`, `MASTERCARD`, `AMEX`, `CASH`, `CHEQUE`, `CRYPTO`, `DINERS_CLUB`, `DISCOVER`, `FINANCING`, `INVOICE`, `TRAVELERS_CHECK`, `APPLE_PAY`, `SAMSUNG_PAY`, `PAYPAL`, `ANDROID_PAY`. |
| input.businessHours | array of objects | isteğe bağlı | Hours. Each entry is `{ day, type, slots }`, plus `specialDate` for a `SPECIAL` entry. Send the full seven-day week when you set hours. |
| input.businessHours[].day | string | zorunlu | One of MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, or SPECIAL (a one-off override for the date in `specialDate`). |
| input.businessHours[].type | string | zorunlu | `OPEN` or `CLOSED`. |
| input.businessHours[].specialDate | string | isteğe bağlı | Date of a one-off override, as `YYYY-MM-DD`. Set this only when `day` is `SPECIAL`. |
| input.businessHours[].slots | array of objects | isteğe bağlı | Open intervals for the day, each `{ start, end }` (e.g. `09:00am`, `05:00pm`). Use an empty array when `type` is `CLOSED`. |
| input.businessHours[].slots[].start | string | zorunlu | Opening time for the interval, e.g. `09:00am`. |
| input.businessHours[].slots[].end | string | zorunlu | Closing time for the interval, e.g. `05:00pm`. |
| input.moreHours | array of objects | isteğe bağlı | Additional hour sets (e.g. delivery, drive-through). Each entry is `{ hoursTypeId, moreHour }`, where `moreHour` is an array of `{ day, type, slots }` using the same shape as `businessHours` (minus `specialDate`). |
| input.serviceArea | object | isteğe bağlı | Service-area business config: `businessType`, `regionCode`, and a `placeInfos` array of `{ placeId, placeName }`. |
| input.customAttributes | array of objects | isteğe bağlı | Custom attribute values for the location. Each item is `{ slug, value }`, where `slug` identifies a custom attribute registered on your account and `value` is an array of strings. Sending a slug that is not registered returns `SY10035`. Registering a new custom attribute is not yet available through the API. |
| input.placeActionLinks | array of objects | isteğe bağlı | Google action links (ordering, delivery, takeout, reservation, appointment). Each item: `placeActionType` (enum), `uri` (string), optional `isPreferred` (boolean), optional `action` (`add`, the default, or `delete`), optional `name` (the link identifier returned by read endpoints once synced to Google). Only the links you reference are affected; links you don't include are left unchanged. See the Place Action Links guide. |
Örnek istek
Yapıştırmaya hazır gövde. Yer tutucu kimlikleri ve değerleri kendi değerlerinizle değiştirin.
{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "phone": "5125550199", "bizUrl": "https://acmekitchen.example.com", "primaryGbpSiteCategoryId": "gcid:restaurant", "businessHours": [ { "day": "MONDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "TUESDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "WEDNESDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "THURSDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "FRIDAY", "type": "OPEN", "slots": [{ "start": "09:00am", "end": "05:00pm" }] }, { "day": "SATURDAY", "type": "OPEN", "slots": [{ "start": "10:00am", "end": "02:00pm" }] }, { "day": "SUNDAY", "type": "CLOSED", "slots": [] } ] }}Yanıtlar
200Location updated. `success` is true and the updated location summary is returned.
{ "data": { "updateLocation": { "clientMutationId": null, "success": true, "errors": null, "location": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "databaseId": 1800289, "name": "Jenny Home", "street": "600 Congress Ave, Suite 200", "city": "Austin", "stateIso": "TX", "countryIso": "US", "postalCode": "78701", "phone": "5125550199", "storeId": null, "status": "APPROVED", "placeActionLinks": [ { "placeActionType": "FOOD_ORDERING", "uri": "https://order.example.com", "isPreferred": true, "name": null, "submissionStatus": null } ], "discoveredPlaceActionLinks": [] } } }}401Unauthenticated, missing or invalid API key.
Tek bir konumu günceller. Yalnızca input içinde bulunan alanlar değiştirilir; belirtmediğiniz tüm alanlar mevcut değerlerini korur. Zorunlu olan tek alan id alanıdır.
Kullanım örneği: telefon numarasını düzeltme. Adresi veya çalışma saatlerini değiştirmeden iletişim bilgilerini düzeltmek için yalnızca id ve phone gönderin. Yanıt, yeni değerlerin kaydedildiğini doğrulayabilmeniz için güncellenmiş konumu döndürür.
Kullanım örneği: haftalık çalışma saatlerinin tamamını yayınlama. Her gün için açık olunan saat aralıklarını ayarlamak üzere yedi günlük businessHours dizisini gönderin (örnek istekteki gibi). Kapalı günleri { "day": "SUNDAY", "type": "CLOSED", "slots": [] } ile işaretleyin.
Çalışma saatleri kuralları.
- Yedi günün tamamını belirtin; eksik bir hafta reddedilir.
- Saatler, her
slotsgirdisindestart/endkullanılarak belirtilir (e.g,09:00am,05:00pm); aynı gün içindeki saat aralıkları çakışmamalıdır. - Tatil ve etkinlikler için normal saatlerin yerine geçecek saatler,
day: "SPECIAL"ve birspecialDate(YYYY-MM-DD) içeren ek girdilerdir; haftanın yedi gününe ait girdilerle birlikte gönderilir, asla onların yerine gönderilmez. SPECIALöğesini yalnızcabusinessHoursiçinde kullanın.moreHoursgirdilerindespecialDatealanı bulunmadığından, buradaki birSPECIALgünü tarih içermez.- İkincil çalışma saatleri (teslimat, araca servis) için
moreHourskullanın ve anahtar olarakhoursTypeIdbelirtin.
Her zaman haftanın tamamını gönderin. Yayın platformları, MONDAY–SUNDAY aralığının tamamını kapsayan çalışma saatleri bekler; businessHours değerini her ayarladığınızda yedi girdinin tamamını gönderin ve çalışılmayan günleri atlamak yerine bu günler için type: "CLOSED" kullanın (slots boş olacak şekilde).
Dikkat edilmesi gerekenler.
- Tanımlayıcı alanı
idalanıdır (her okuma uç noktasının döndürdüğü Base64 Relay ID). - Doğrulama başarısız olduğunda çağrı yine de
success: falseve doldurulmuş birerrorsdizisiyle HTTP 200 döndürür; her zaman yalnızca durum kodunu değil,successdeğerini de kontrol edin.
Konum işlem bağlantıları
placeActionLinks, bir konumun Google işlem düğmelerini (sipariş, teslimat, paket servis, rezervasyon, randevu) yönetir. Yazma modeli, mevcut bağlantıların tümünü değiştirmek yerine append/upsert kullanır:
action: "add"(varsayılan): yeni bir bağlantı ekler veya kaydedilmiş bir bağlantınınuri/isPreferreddeğerlerini yerinde günceller.action: "delete": kaydedilmiş bir bağlantıyı kaldırır ve Google'dan kaldırılmasını kuyruğa alır.- İstekte belirtmediğiniz bağlantılar değiştirilmeden bırakılır; bir bağlantıyı belirtmemek onu asla kaldırmaz.
Bağlantı nasıl eşleştirilir (düzenleme/silme için): varsa name ile, yoksa placeActionType + uri ile. En doğru eşleşme için, elinizde varsa name değerini (bir okuma uç noktasından alınan) ekleyin; henüz Google ile senkronize edilmemiş bir bağlantının name değeri yoktur ve bu bağlantı placeActionType + uri ile eşleştirilir.
Geçerli placeActionType değerleri: APPOINTMENT, ONLINE_APPOINTMENT, DINING_RESERVATION, FOOD_ORDERING, FOOD_DELIVERY, FOOD_TAKEOUT, SHOP_ONLINE. Her tür için en fazla bir tercih edilen bağlantı olabilir.
Bir bağlantının URL'sini değiştirme = aynı istekte eski bağlantıyı kaldırma + yeni bağlantıyı ekleme:
{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "placeActionLinks": [ { "placeActionType": "FOOD_ORDERING", "uri": "https://order.example.com", "name": "<link-name-if-synced>", "action": "delete" }, { "placeActionType": "FOOD_ORDERING", "uri": "https://new-order.example.com", "isPreferred": true, "action": "add" } ] }}Bir yazma işleminden hemen sonra, bağlantının name ve submissionStatus alanlarının değeri null olur; bağlantı Google ile senkronize edildiğinde bu alanlar doldurulur. Doğrudan Google'da keşfedilen bağlantıların discoveredPlaceActionLinks altında nasıl göründüğü dahil tüm akış için Konum işlem bağlantıları kılavuzuna bakın.
curl -X POST 'https://listingsapi.com/api/v4/locations/update' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "id": "TG9jYXRpb246MTgwMDI4OQ==", "phone": "5125550199", "bizUrl": "https://acmekitchen.example.com", "primaryGbpSiteCategoryId": "gcid:restaurant", "businessHours": [ { "day": "MONDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "TUESDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "WEDNESDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "THURSDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "FRIDAY", "type": "OPEN", "slots": [ { "start": "09:00am", "end": "05:00pm" } ] }, { "day": "SATURDAY", "type": "OPEN", "slots": [ { "start": "10:00am", "end": "02:00pm" } ] }, { "day": "SUNDAY", "type": "CLOSED", "slots": [] } ] } }'