עסקים יכולים להוסיף את השירותים שהם מספקים לדפי העסק בפרופיל העסק. השירותים האלה יכולים לכלול שירותים שניתנים בחנות או שירותים שניתנים במיקומים של הלקוחות.
זכאות ופורמט
לא כל העסקים יכולים להוסיף שירותים לדף העסקי בפרופיל. כדי לבדוק את הזכאות, בודקים את המצב של canModifyServiceList
בקטע Metadata.
שירות מיוצג כ-ServiceItem, שתומך בשני הפורמטים הבאים:
- StructuredServiceItem: אפשר לייצג את השירותים המוגדרים מראש של Google כ-
StructuredServiceItem
שמכילserviceTypeId
. - FreeFormServiceItem: כדי להציע שירותים מותאמים אישית, משתמשים ב-
FreeFormServiceItem
שמכיל Label.
הצגת רשימה של שירותים מוגדרים מראש לפי שם הקטגוריה
כדי לחפש שירותים מוגדרים מראש בקטגוריה לפי שם הקטגוריה, משתמשים ב-categories.list. בקשה לכל הקטגוריות שכוללת את השם salon
בסינגפור מוצגת בקטע הבקשה הבא.
בקשה
צריך להגדיר את CategoryView לערך FULL
.
GET https://mybusinessbusinessinformation.googleapis.com/v1/categories?regionCode=SG&languageCode=EN&filter=displayname=salon&view=FULL
תשובה
התשובה החלקית הבאה מחזירה את כל ServiceTypes הנתמכים.
{ "categories": [ { "name": "gcid:hair_salon", "displayName": "Hairdresser", "serviceTypes": [ { "serviceTypeId": "job_type_id:body_waxing", "displayName": "Body Waxing" }, { "serviceTypeId": "job_type_id:hair_coloring", "displayName": "Hair coloring" }, { "serviceTypeId": "job_type_id:hair_extensions", "displayName": "Hair extensions" }, { "serviceTypeId": "job_type_id:hair_styling", "displayName": "Hair styling" }, { "serviceTypeId": "job_type_id:manicures", "displayName": "Manicures" }, { "serviceTypeId": "job_type_id:pedicures", "displayName": "Pedicures" } ] } }
הצגת רשימה של שירותים מוגדרים מראש לפי מזהה קטגוריה
כדי לחפש שירותים מוגדרים מראש לפי מזהה קטגוריה ספציפי, משתמשים ב-categories.batchGet. בקשה לקבלת פרטים לגבי מזהה הקטגוריה gcid:electrician
בארצות הברית מוצגת בקטע הבא 'בקשה'.
בקשה
צריך להגדיר את CategoryView לערך FULL
.
GET https://mybusinessbusinessinformation.googleapis.com/v1/categories:batchGet?regionCode=US&languageCode=en&names=gcid:electrician&view=FULL
תשובה
התשובה מכילה את כל ServiceTypes הנתמכים עבור gcid:electrician
.
{ "categories": [ { "name": "gcid:electrician", "displayName": "Electrician", "serviceTypes": [ { "serviceTypeId": "job_type_id:construction", "displayName": "Construction" }, { "serviceTypeId": "job_type_id:electric_car_charger", "displayName": "Install electric car charger" }, { "serviceTypeId": "job_type_id:electrician_remodeling", "displayName": "Remodeling" }, { "serviceTypeId": "job_type_id:general_repairs", "displayName": "General repairs" }, { "serviceTypeId": "job_type_id:install_fan", "displayName": "Install fan" }, { "serviceTypeId": "job_type_id:install_ground_wire", "displayName": "Install ground wire" }, { "serviceTypeId": "job_type_id:install_light_fixtures", "displayName": "Install light fixtures" }, { "serviceTypeId": "job_type_id:install_outdoor_lighting", "displayName": "Install outdoor lighting" }, { "serviceTypeId": "job_type_id:install_outlets_switches", "displayName": "Install outlets or switches" }, { "serviceTypeId": "job_type_id:install_security_system", "displayName": "Install security system" }, { "serviceTypeId": "job_type_id:installation", "displayName": "Installation" }, { "serviceTypeId": "job_type_id:relocate_outlets_switches", "displayName": "Relocate outlets or switches" }, { "serviceTypeId": "job_type_id:repair_fan", "displayName": "Repair fan" }, { "serviceTypeId": "job_type_id:repair_light_fixtures", "displayName": "Repair light fixtures" }, { "serviceTypeId": "job_type_id:repair_outlets_switches", "displayName": "Repair outlets or switches" }, { "serviceTypeId": "job_type_id:repair_panel", "displayName": "Repair panel" }, { "serviceTypeId": "job_type_id:replace_upgrade_panel", "displayName": "Replace or upgrade panel" }, { "serviceTypeId": "job_type_id:restore_power", "displayName": "Restore power" } ] } ] }
הצגת רשימה של שירותים קיימים בדף עסקי
כדי לקבל רשימה עדכנית של השירותים, משתמשים ב-locations.get וב-setreadMask=serviceItems
בקשה
GET https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?readMask=serviceItems
תשובה
דוגמה לתשובה
{ "serviceItems": [ { "structuredServiceItem": { "serviceTypeId": "job_type_id:hair_coloring" } }, { "isOffered": true, "structuredServiceItem": { "serviceTypeId": "job_type_id:hair_styling" } }, { "isOffered": true, "freeFormServiceItem": { "categoryId": "gcid:barber_shop", "label": { "displayName": "Student Cuts" } } } ] }
הגדרת שירותים בנכס
כדי לעדכן את השירותים, משתמשים ב-locations.patch וב-updateMask=serviceItems
. אין תמיכה בעדכון של שירותים ספציפיים.
כדי להגדיר שירותים באמצעות StructuredServiceItem ו-FreeFormServiceItem, אפשר להיעזר בדוגמה הבאה:
PATCH https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}?updateMask=serviceItems { "serviceItems":[ { "isOffered":false, "structuredServiceItem":{ "serviceTypeId":"job_type_id:hair_coloring" } }, { "isOffered":true, "structuredServiceItem":{ "serviceTypeId":"job_type_id:hair_styling" } }, { "isOffered":true, "freeFormServiceItem":{ "categoryId":"gcid:hair_salon", "label":{ "displayName":"Student Cuts" } } } ] }