new_releases 更新:查看
版本说明,了解新功能和产品动态。
列出运营商(区域)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
在 RBM Management API 中,可以启动 RBM 代理的运营商网络被定义为“区域”。
RBM 支持团队会维护最新的运营商列表,随着越来越多的运营商采用 RBM,该列表也会不断扩大。
本页中的代码段摘自 Java 示例和 Node.js 示例。
列出区域
您需要先检索可发布代理的区域列表,然后才能提交代理以供发布。如需了解详情,请参阅 regions.list
。
Node.js
const businessCommunicationsApiHelper =
require('@google/rbm-businesscommunications');
const privateKey =
require('../../resources/businesscommunications-service-account-credentials.json');
businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);
businessCommunicationsApiHelper.listRegions().then((response) => {
console.log(response.data);
}).catch((err) => {
console.log(err);
});
Java
List<RcsBusinessMessagingRegion> regions = api.listAllRbmLaunchRegions();
List<String> regionIds = regions.stream().map(RcsBusinessMessagingRegion::getName).sorted()
.collect(Collectors.toList());
logger.info("Fetched region Ids: " + regionIds);
此代码会返回可提交代理以供发布的所有运营商的列表:
{
regions: [
{
name: '/v1/regions/dt-germany',
displayName: 'Germany: DT',
managementType: 'CARRIER_MANAGED'
},
{
name: '/v1/regions/9mobile-nigeria',
displayName: 'Nigeria: 9 Mobile',
managementType: 'GOOGLE_MANAGED'
},
...
...
]
}
列为 CARRIER_MANAGED
的运营商会自行执行审批流程,并会针对向其订阅者递送 RBM 消息收取费用。您需要直接与这些运营商签订商业协议,然后才能向其订阅者传送 RBM 消息。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-01-16。
[null,null,["最后更新时间 (UTC):2025-01-16。"],[[["\u003cp\u003e"Regions" in the RBM Management API refer to the carrier networks where an RBM agent can be launched.\u003c/p\u003e\n"],["\u003cp\u003eThe RBM Support team keeps an updated list of carriers that support RBM, which is constantly expanding.\u003c/p\u003e\n"],["\u003cp\u003eYou must retrieve a list of launchable regions using the \u003ccode\u003eregions.list\u003c/code\u003e endpoint before you can submit an agent for launch.\u003c/p\u003e\n"],["\u003cp\u003eCode samples for listing regions are available in both Java and Node.js, and these examples demonstrate how to retrieve the available carrier networks.\u003c/p\u003e\n"],["\u003cp\u003eCarriers listed as \u003ccode\u003eCARRIER_MANAGED\u003c/code\u003e have their own approval process and require a commercial agreement before delivering RBM messages to their subscribers.\u003c/p\u003e\n"]]],[],null,["# List carriers (regions)\n\nThe carrier networks where an RBM agent can be launched are defined as \"regions\"\nin the RBM Management API.\n\nThe RBM Support team maintains an up-to-date carrier list, which grows as more\ncarriers adopt RBM.\n\nCode snippets on this page are taken from the [Java samples](https://github.com/rcs-business-messaging/rbm-api-examples/tree/master/java/rbm-mgmt-api)\nand [Node.js samples](https://github.com/rcs-business-messaging/rbm-api-examples/tree/master/nodejs/rbm-mgmt-api).\n\nList regions\n------------\n\nYou need to retrieve a list of the launchable regions before you can submit\nan agent for launch. For more details, see [`regions.list`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/regions/list). \n\n### Node.js\n\n```javascript\nconst businessCommunicationsApiHelper =\n require('@google/rbm-businesscommunications');\n\nconst privateKey =\n require('../../resources/businesscommunications-service-account-credentials.json');\n\nbusinessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);\n\nbusinessCommunicationsApiHelper.listRegions().then((response) =\u003e {\n console.log(response.data);\n}).catch((err) =\u003e {\n console.log(err);\n}); \n```\n\n### Java\n\n```java\nList\u003cRcsBusinessMessagingRegion\u003e regions = api.listAllRbmLaunchRegions();\nList\u003cString\u003e regionIds = regions.stream().map(RcsBusinessMessagingRegion::getName).sorted()\n .collect(Collectors.toList());\nlogger.info(\"Fetched region Ids: \" + regionIds);\n```\n\nThis code returns a list of all the carriers where an agent can be\nsubmitted for launch: \n\n {\n regions: [\n {\n name: '/v1/regions/dt-germany',\n displayName: 'Germany: DT',\n managementType: 'CARRIER_MANAGED'\n },\n {\n name: '/v1/regions/9mobile-nigeria',\n displayName: 'Nigeria: 9 Mobile',\n managementType: 'GOOGLE_MANAGED'\n },\n ...\n ...\n ]\n }\n\nCarriers which are listed as `CARRIER_MANAGED` operate their own approval\nprocess and charge for delivery of RBM messages to their subscribers. You\nneed to have a commercial agreement in place directly with these carriers\nbefore you can deliver RBM messages to their subscribers."]]