מאפיינים מאפשרים לעסקים לכלול מידע נוסף, כמו אפשרויות נגישות ושירותים.
רשימת המאפיינים הזמינים (מטא-נתונים)
כדי לגלות אילו מאפיינים נתמכים בקטגוריה של העסק ובמדינה, שולחים בקשה אל attributes.list.
המאפיינים הם דינמיים וצריך לאחזר אותם לעיתים קרובות. ראו את הדוגמה שמוצגת בקטע הבא.
בקשה
כדי להציג את המאפיינים הזמינים לקטגוריה, קוד אזור וקוד שפה מסוימים:
GET https://mybusinessbusinessinformation.googleapis.com/v1/attributes?regionCode=US&languageCode=EN&categoryName=gcid:restaurant
כדי להציג את המאפיינים הזמינים של דף עסקי מסוים באמצעות מזהה המיקום שלו:
GET https://mybusinessbusinessinformation.googleapis.com/v1/attributes?parent=locations/{locationId}תשובה
התגובה החלקית הבאה מחזירה הגדרות של מאפיינים עם ערכים שונים של AttributeValueType. שימו לב שהשדה valueMetadata מתאר את הערכים המותרים ואת השמות שלהם לתצוגה, ולא את הערכים שנבחרו למיקום.
{ "attributes": [ { "attributeId": "has_live_music", "valueType": "BOOL", "displayName": "Live music", "groupDisplayName": "Highlights", "valueMetadata": [ { "value": true, "displayName": "Live music" } ], "displayStrings": { "uiText": "Live music", "standaloneText": "Has live music", "negativeText": "No live music" } }, { "attributeId": "has_wheelchair_accessible_entrance", "valueType": "BOOL", "displayName": "Wheelchair accessible entrance", "groupDisplayName": "Accessibility", "valueMetadata": [ { "value": true, "displayName": "Wheelchair accessible entrance" }, { "value": false, "displayName": "No wheelchair accessible entrance" } ], "displayStrings": { "uiText": "Wheelchair accessible entrance", "standaloneText": "Has wheelchair accessible entrance", "negativeText": "No wheelchair accessible entrance" } }, { "attributeId": "has_braille_menu", "valueType": "BOOL", "displayName": "Braille menu", "groupDisplayName": "Offerings", "valueMetadata": [ { "value": true, "displayName": "Braille menu" } ], "displayStrings": { "uiText": "Braille menu", "standaloneText": "Has braille menu", "negativeText": "No braille menu" } }, { "attributeId": "has_no_contact_delivery", "valueType": "BOOL", "displayName": "No-contact delivery", "groupDisplayName": "Offerings", "valueMetadata": [ { "value": true, "displayName": "No-contact delivery" } ], "displayStrings": { "uiText": "No-contact delivery", "standaloneText": "Has no-contact delivery", "negativeText": "No no-contact delivery" } }, { "attributeId": "welcomes_lgbtq", "valueType": "BOOL", "displayName": "LGBTQ friendly", "groupDisplayName": "Planning", "valueMetadata": [ { "value": true, "displayName": "LGBTQ friendly" } ], "displayStrings": { "uiText": "LGBTQ friendly", "standaloneText": "LGBTQ friendly", "negativeText": "Not showing LGBT friendly" } }, { "attributeId": "wi_fi", "valueType": "ENUM", "displayName": "Wi-Fi", "groupDisplayName": "Amenities", "valueMetadata": [ { "value": "free_wi_fi", "displayName": "Free" }, { "value": "paid_wi_fi", "displayName": "Paid" } ], "displayStrings": { "uiText": "Wi-Fi", "standaloneText": "Has Wi-Fi", "negativeText": "No Wi-Fi" } }, { "attributeId": "pay_credit_card_types_accepted", "valueType": "REPEATED_ENUM", "displayName": "Credit cards", "groupDisplayName": "Payments", "isRepeatable": true, "valueMetadata": [ { "value": "american_express", "displayName": "American Express" }, { "value": "china_union_pay", "displayName": "China Union Pay" }, { "value": "diners_club", "displayName": "Diners Club" }, { "value": "discover", "displayName": "Discover" }, { "value": "jcb", "displayName": "JCB" }, { "value": "mastercard", "displayName": "MasterCard" }, { "value": "visa", "displayName": "VISA" } ], "displayStrings": { "uiText": "Credit cards", "standaloneText": "Credit cards accepted", "negativeText": "Credit cards not accepted" } } ] }
קבלת מאפיינים של דף אפליקציה
כדי לאחזר את המאפיינים והערכים שהוגדרו למיקום ספציפי, משתמשים ב-locations.getAttributes.
מאפיינים בניהול המוכר
כדי לקבל את המאפיינים כפי שהוגדרו על ידי המוכר:
GET https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}/attributesהתגובה מחזירה את הערכים שהוגדרו בפועל למיקום:
{
"name": "locations/{locationId}/attributes",
"attributes": [
{
"name": "attributes/has_wheelchair_accessible_seating",
"valueType": "BOOL",
"values": [
false
]
},
{
"name": "attributes/wi_fi",
"valueType": "ENUM",
"values": [
"free_wi_fi"
]
}
]
}מאפיינים שעודכנו על ידי Google (תצוגה בזמן אמת)
כדי לאחזר מאפיינים כפי שהם מופיעים בחיפוש Google ובמפות Google (שעשויים לכלול עדכונים של Google או תוכן שנוצר על ידי משתמשים), משתמשים ב-locations.attributes.getGoogleUpdated:
GET https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}/attributes:getGoogleUpdatedמאפיינים מורחבים עם סטטוס עריכה (v1alpha)
כדי לאחזר בקריאה אחת גם את המאפיינים שסיפק המוכר וגם את המאפיינים שמוצגים לצרכנים, יחד עם שלבי מחזור החיים של העריכה לכל מאפיין (כמו EDIT_LIFECYCLE_STAGE_PENDING או EDIT_LIFECYCLE_STAGE_REJECTED), מקור העריכה (SOURCE_API או SOURCE_UI) והסיבות להפרת המדיניות, משתמשים ב-locations.attributes.getExtended ב-v1alpha:
GET https://mybusinessbusinessinformation.googleapis.com/v1alpha/locations/{locationId}/attributes:getExtendedבמאמר בדיקת סטטוס העריכה של מיקומים ומאפיינים מפורטות דוגמאות לתגובות מלאות ומוסבר איך לפרש את סטטוס העריכה של המאפיינים ואת הפרות המדיניות.
הגדרת מאפיינים של דף אפליקציה
כדי להגדיר מאפיינים באמצעות locations.updateAttributes, מגדירים את הפרמטר attributeMask עם המאפיינים שרוצים לעדכן.
בדוגמה הבאה מוגדרים סוגי כרטיסי האשראי המקובלים ומאפייני אפשרויות המשלוח של כרטיס מוצר.
PATCH https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}/attributes?attributeMask=pay_credit_card_types_accepted,has_no_contact_delivery { "name": "locations/{locationId}/attributes", "attributes": [ { "name": "has_no_contact_delivery", "values": [ true ] }, { "name": "pay_credit_card_types_accepted", "repeatedEnumValue": { "setValues": [ "american_express", "visa" ] } } ] }