एट्रिब्यूट मैनेज करना

एट्रिब्यूट की मदद से, कारोबारों को अतिरिक्त जानकारी शामिल करने की सुविधा मिलती है. जैसे, सुलभता के विकल्प और सुविधाएं.

उपलब्ध एट्रिब्यूट (मेटाडेटा) की सूची बनाना

किसी कारोबार की कैटगरी और देश के लिए, किन एट्रिब्यूट का इस्तेमाल किया जा सकता है, यह जानने के लिए 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 Search और Maps पर लाइव दिखने वाले एट्रिब्यूट को वापस पाने के लिए, locations.attributes.getGoogleUpdated का इस्तेमाल करें. इन एट्रिब्यूट में, Google अपडेट या यूज़र जनरेटेड कॉन्टेंट शामिल हो सकता है:

एचटीटीपी
GET https://mybusinessbusinessinformation.googleapis.com/v1/locations/{locationId}/attributes:getGoogleUpdated

बदलाव की स्थिति के साथ एक्सटेंडेड एट्रिब्यूट (v1alpha)

कारोबारी या कंपनी के दिए गए एट्रिब्यूट और उपभोक्ता को दिखने वाले एट्रिब्यूट, दोनों को वापस पाने के लिए, v1alpha में locations.attributes.getExtended का इस्तेमाल करें. साथ ही, हर एट्रिब्यूट के लिए, बदलाव की लाइफ़साइकल के चरणों (जैसे, EDIT_LIFECYCLE_STAGE_PENDING या EDIT_LIFECYCLE_STAGE_REJECTED), बदलाव के सोर्स (SOURCE_API या SOURCE_UI), और नीति के उल्लंघन की वजहों को एक ही कॉल में वापस पाने के लिए, v1alpha में locations.attributes.getExtended का इस्तेमाल करें:

एचटीटीपी
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"
        ]
      }
    }
  ]
}