إنّ جميع موظّفي الدعم الذين تم إنشاؤهم من خلال واجهة برمجة التطبيقات RBM Management API يستخدمون تلقائيًا رابطًا واحدًا لرسائل الترحيب. يتم ضبط ميزة الردّ التلقائي على الويب على مستوى الشريك في Business Communications Developer Console وينطبق ذلك على جميع موظّفي الدعم في حساب شريكك.
بدلاً من ذلك، يمكنك استخدام RBM Management API لضبط مواقع ويب webhook على مستوى موظّف الدّعم. قد يكون هذا الخيار جيدًا إذا كنت تدير عدة موظّفي دعم يتبعون سلوكًا مختلفًا.
تمّ استخراج مقتطفات الرموز البرمجية في هذه الصفحة من عيّنات Java وعيّنات Node.js.
إنشاء عملية دمج webhook
لإضافة عملية دمج webhook مع موظّف الدعم، حدِّد أولاً عنوان URL لـ webhook و
حدِّد رمز صحة. بعد ذلك، عليك ضبط رابط webhook لاتّباع
خطوات التحقّق.
بعد الضبط، استخدِم الطريقة createWebhookIntegration
مع قيم عنوان URL و
الرمز المميّز. في حال نجاح هذه المكالمة، يمكنك المتابعة من خلال
التحقّق من الرسائل الواردة ومعالجتها.
لمزيد من التفاصيل، يُرجى الاطّلاع على
brands.agents.integrations
وbrands.agents.integrations.create
.
Node.js
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); const url = 'https://myrbmserviceendpoint.somewhere.com/callback'; const token = '123456'; businessCommunicationsApiHelper .createWebhookIntegration(agent.name, url, token) .then((response) => { console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); } );
تعرض هذه التعليمات البرمجية عنصر webhook الجديد:
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_hfaoplpu_agent/integrations/4efdb82f-fd6d-4ba4-8ea3-f2f4a60d1547",
"status": "ENABLED",
"agentWebhookIntegration": {
"webhookUri": "https://myrbmserviceendpoint.somewhere.com/callback"
}
}
البحث عن عمليات دمج طلبات الويب الخاصة بالوكيل
يمكنك استرداد قائمة بجميع عمليات دمج وحدات الربط التي يملكها موظّف دعم.
من الناحية العملية، لا يمتلك وكيل RBM سوى عملية دمج واحدة لوحدة ربط طلبات الويب. لمزيد من
التفاصيل، يُرجى الاطّلاع على brands.agents.integrations.list
.
Node.js
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper .listAgentIntegrations(agent.name) .then((response) => { console.log(JSON.stringify(response.data, null, 2)); datastore.saveJsonData('integrations', response.data); }).catch((err) => { console.log(err); });
يعرض هذا الرمز قائمة بعمليات دمج طلبات الويب للوكيل:
{
"integrations": [
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_hfaoplpu_agent/integrations/4efdb82f-fd6d-4ba4-8ea3-f2f4a60d1547",
"status": "ENABLED",
"agentWebhookIntegration": {
"webhookUri": "https://myrbmserviceendpoint.somewhere.com/callback"
}
}
]
}
البحث عن تفاصيل عملية دمج
يمكنك استرداد تفاصيل الدمج إذا كان لديك مرجع لمحاولة دمج. لمزيد من التفاصيل، يُرجى الاطّلاع على brands.agents.integrations.get
.
Node.js
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper .getAgentIntegration(integrations.integrations[0].name) .then((response) => { console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); });
تعرِض هذه التعليمات البرمجية تفاصيل دمج وحدات الربط لطلبات البحث:
{
"name": "brands/40bd963f-ff92-425c-b273-8f0892d2d017/agents/my_new_agent_hfaoplpu_agent/integrations/4efdb82f-fd6d-4ba4-8ea3-f2f4a60d1547",
"status": "ENABLED",
"agentWebhookIntegration": {
"webhookUri": "https://myrbmserviceendpoint.somewhere.com/callback"
}
}
إزالة ميزة "الردّ التلقائي على الإنترنت"
يمكنك إزالة رابط ويب للطلبات من موظّف دعم باستخدام مرجعه. لمزيد من
التفاصيل، يُرجى الاطّلاع على brands.agents.integrations.delete
.
Node.js
const businessCommunicationsApiHelper = require('@google/rbm-businesscommunications'); const privateKey = require('../../resources/businesscommunications-service-account-credentials.json'); businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey); businessCommunicationsApiHelper .deleteAgentIntegration(integrations.integrations[0].name) .then((response) => { console.log(JSON.stringify(response.data, null, 2)); }).catch((err) => { console.log(err); });
يتم عرض عنصر فارغ:
{}