मैसेज की उपलब्धता सेट करना

आपके एजेंट से बातचीत शुरू करने से पहले, उपयोगकर्ताओं को Business Messages में जाकर, अपने एजेंट के लिए मैसेज की उपलब्धता सेट करनी होगी.

अगर उपलब्ध समय के दौरान कोई उपयोगकर्ता आपके एजेंट को मैसेज करता है, तो उसका एजेंट स्वागत मैसेज और बातचीत की शुरुआत कर उस उपयोगकर्ता का स्वागत करता है. अगर बातचीत की सुविधा उपलब्ध समय के बाद शुरू होती है, तो लोगों को एजेंट का ऑफ़लाइन मैसेज दिखता है. इन मैसेज के बारे में ज़्यादा जानकारी के लिए, बातचीत शुरू करें देखें.

बॉट और इंसान की उपलब्धता

आपके पास अलग-अलग बॉट और लोगों की रिप्रज़ेंटेटिव उपलब्धता की जानकारी देने का विकल्प होता है.

अगर आपके एजेंट के लिए किसी भी तरह का ऑटोमेशन मैसेज है, तो क्या ऑटो-रिस्पॉन्स लेने से उपयोगकर्ताओं को कतार में अपनी जगह के बारे में पता चलता है, यह एक जटिल भाषा का समझ रखने वाला एजेंट है जिसके पास उपयोगकर्ता की जानकारी का डाइनैमिक ऐक्सेस होता है या इन दोनों के बीच किसी भी मैसेज के बारे में बताएं.

अगर किसी एजेंट को जगह के हिसाब से एंट्री पॉइंट और गैर-स्थानीय एंट्री पॉइंट (Google Ads को छोड़कर) पर लॉन्च करना है, तो मैन्युअल तरीके से उपलब्धता को ज़रूरी बनाना चाहिए. मैन्युअल उपलब्धता के लिए, सिर्फ़ हफ़्ते के दिन और घंटे बताएं, जब आपके पास सवालों के जवाब देने के लिए लाइव एजेंट उपलब्ध हों.

अगर बॉट के प्रतिनिधि दिन में 24 घंटे उपलब्ध हैं, लेकिन मानव प्रतिनिधि सुबह 8 बजे से रात 8 बजे तक उपलब्ध रहते हैं, तो आप स्वतंत्र रूप से उनके बारे में बता सकते हैं.

साथ ही, अगर बॉट और लोगों की उपलब्धता, दोनों की जानकारी दी जाती है, तो बॉट के प्रतिनिधि की ज़रूरतों को पूरा न करने पर, लाइव एजेंट से लाइव एजेंट के लिए अनुरोध करने के लिए, लाइव एजेंट के लिए अनुरोध के सुझाव भेजे जा सकते हैं.

मैसेज सेवा की उपलब्धता अपडेट करें

मैसेज की उपलब्धता अपडेट करने के लिए, एजेंट के primaryAgentInteraction और additionalAgentInteractions फ़ील्ड अपडेट करने के लिए, Business Communications API से अनुरोध करें.

इन फ़ील्ड को अपडेट करते समय, आपको उन सभी फ़ील्ड की वैल्यू शामिल करनी होंगी जो SupportAgentResponse ऑब्जेक्ट में होती हैं. अपडेट करने के अनुरोध में ऐसे सभी फ़ील्ड का कॉन्टेंट बदल जाता है जिनमें आप बदलाव करते हैं. इनमें, बच्चों के लिए बना फ़ील्ड भी शामिल है. उदाहरण के लिए, अगर आपने hours में इंस्टेंस जोड़ने का अनुरोध किया है, तो आपको पहले के सभी hours इंस्टेंस भी शामिल करने होंगे. ऐसा न करने पर, आपका अपडेट उन्हें ओवरराइट कर देगा.

ज़रूरी शर्तें

इससे पहले कि आप मैसेज सेवा की उपलब्धता अपडेट करें, आपको इन आइटम की ज़रूरत होगी:

  • आपकी डेवलपमेंट मशीन पर मौजूद आपके GCP प्रोजेक्ट की सेवा खाता कुंजी का पाथ
  • एजेंट name (उदाहरण के लिए, "brands/12345/agents/67890")

    अगर आपको एजेंट के name के बारे में नहीं पता है, तो किसी ब्रैंड के सभी एजेंट की जानकारी दें देखें.

  • बॉट की उपलब्धता वाला समय क्षेत्र, हफ़्ते के दिन, और घंटे

  • मानवीय उपलब्धता समय क्षेत्र, हफ़्ते के दिन और घंटे

अगर आपको मौजूदा primaryAgentInteraction और additionalAgentInteractions की वैल्यू के बारे में नहीं पता है, तो एजेंट की जानकारी पाएं देखें.

अपडेट का अनुरोध भेजें

एजेंट को अपडेट करने के लिए, यह कमांड चलाएं. वैरिएबल को उन वैल्यू से बदलें जिन्हें आपने ज़रूरी शर्तों में पहचाना है.

अगर आपके पास बॉट और लोगों के मैसेज, दोनों की उपलब्धता है, तो primaryAgentInteraction में बॉट की उपलब्धता के बारे में बताएं. साथ ही, additionalAgentInteractions के मामले में लोगों की उपलब्धता के बारे में बताएं.

बॉट और इंसान


# This code updates the agent interaction of a bot and human representatives.
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction,businessMessagesAgent.additionalAgentInteractions" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "BOT",
      "botRepresentative": {
        "botMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    },
    "additionalAgentInteractions": [
      {
        "interactionType": "HUMAN",
        "humanRepresentative": {
          "humanMessagingAvailability": {
            "hours": [
              {
                "startTime": {
                  "hours": 8,
                  "minutes": 0
                },
                "endTime": {
                  "hours": 20,
                  "minutes": 0
                },
                "timeZone": "America/Los_Angeles",
                "startDay": "MONDAY",
                "endDay": "SUNDAY"
              }
            ]
          }
        }
      }
    ]
  }
}'

सिर्फ़ बॉट के लिए


# This code updates the primary agent interaction of a bot representative
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "BOT",
      "botRepresentative": {
        "botMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    }
  }
}'

सिर्फ़ इंसान के लिए


# This code updates the primary agent interaction of a human representative
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "HUMAN",
      "humanRepresentative": {
        "humanMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    }
  }
}'

फ़ॉर्मैटिंग और वैल्यू के विकल्पों के लिए, brands.agents.patch और SupportedAgentInteraction देखें.