Stay organized with collections
Save and categorize content based on your preferences.
All agents belong to a brand (business, organization, or group). Before an agent
can be created, it's necessary to create an owning brand. Brands are purely
organizational to help you group related agents together.
constbusinessCommunicationsApiHelper=require('@google/rbm-businesscommunications');constprivateKey=require('../../resources/businesscommunications-service-account-credentials.json');businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);businessCommunicationsApiHelper.createBrand('My new brand').then((response)=>{console.log('The new brand is:');console.log(response.data);}).catch((err)=>{console.log(err);});
{
name: 'brands/17456b6b-65dc-4e35-b128-fd3047664ddf',
displayName: 'My new brand'
}
List brands
You can retrieve a list of all the brands you have created. For more details,
see brands.list.
Node.js
constbusinessCommunicationsApiHelper=require('@google/rbm-businesscommunications');constprivateKey=require('../../resources/businesscommunications-service-account-credentials.json');businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);businessCommunicationsApiHelper.listBrands().then((response)=>{console.log('Current brands available are:');console.log(response.data);}).catch((err)=>{console.log(err);});
You can change the brand's display name. For more details, see brands.patch.
The brand's display name can be changed using the patch operation:
Node.js
constbusinessCommunicationsApiHelper=require('@google/rbm-businesscommunications');constprivateKey=require('../../resources/businesscommunications-service-account-credentials.json');businessCommunicationsApiHelper.initBusinessCommunucationsApi(privateKey);businessCommunicationsApiHelper.patchBrand(brand.name,'My brand new name').then((response)=>{console.log(response.data);});
This code returns the updated brand information:
{
name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017',
displayName: 'My brands new name'
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-16 UTC."],[[["\u003cp\u003eBrands serve as organizational structures for grouping related agents within the system.\u003c/p\u003e\n"],["\u003cp\u003eNew brands can be created using the provided Node.js and Java code examples, which return a unique identifier and the brand's display name.\u003c/p\u003e\n"],["\u003cp\u003eInformation about a specific brand can be retrieved using its unique identifier through the provided code snippets.\u003c/p\u003e\n"],["\u003cp\u003eA list of all created brands can be obtained using the \u003ccode\u003elistBrands\u003c/code\u003e function, with examples provided in both Node.js and Java.\u003c/p\u003e\n"],["\u003cp\u003eThe display name of an existing brand can be modified using the \u003ccode\u003epatchBrand\u003c/code\u003e function, demonstrated with a Node.js example.\u003c/p\u003e\n"]]],[],null,["# Manage brands\n\nAll agents belong to a brand (business, organization, or group). Before an agent\ncan be created, it's necessary to create an owning brand. Brands are purely\norganizational to help you group related agents together.\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\nCreate a brand\n--------------\n\nYou can create a new brand. For more details,\nsee [`brands`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands)\nand [`brands.create`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands/create). \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.createBrand('My new brand').then((response) =\u003e {\n\tconsole.log('The new brand is:');\n\tconsole.log(response.data);\n}).catch((err) =\u003e {\n\tconsole.log(err);\n});\n```\n\n### Java.js\n\n```javascript\nString displayName = flags.getOrDefault(\"brand_name\", \"Test brand: \" + now.getSecond());\nBrand brand = api.createBrand(displayName);\nlogger.info(\"New brand id: \" + brand.getName());\n```\n\nThis code returns the new brand name (`displayName`) and a unique identifier\n(`name`) assigned to the brand: \n\n {\n name: 'brands/17456b6b-65dc-4e35-b128-fd3047664ddf',\n displayName: 'My new brand'\n }\n\nRetrieve a brand\n----------------\n\nYou can retrieve information about a brand using its unique identifier (`name`).\nFor more details, see [`brands.get`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands/get). \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.getBrand(brandId).then((response) =\u003e {\n console.log('Brand details are:');\n console.log(response.data);\n}).catch((err) =\u003e {\n console.log(err);\n});\n```\n\n### Java\n\n```java\nBrand brand = api.getBrand(brandId);\nlogger.info(\"Brand: \" + brand);\n```\n\nThis code returns the brand information: \n\n {\n name: 'brands/17456b6b-65dc-4e35-b128-fd3047664ddf',\n displayName: 'My new brand'\n }\n\nList brands\n-----------\n\nYou can retrieve a list of all the brands you have created. For more details,\nsee [`brands.list`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands/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.listBrands().then((response) =\u003e {\n console.log('Current brands available are:');\n console.log(response.data);\n}).catch((err) =\u003e {\n console.log(err);\n});\n```\n\n### Java\n\n```java\nList\u003cBrand\u003e brands = api.listBrands().stream().sorted(Comparator.comparing(Brand::getName))\n .collect(Collectors.toList());\nlogger.info(String.format(\"Found %d brands\", brands.size()));\nfor (Brand brand : brands) {\n logger.info(String.format(\"Brand [%s]: '%s'\", brand.getName(), brand.getDisplayName()));\n}\n```\n\nThis code returns a list of all your brands: \n\n {\n brands: [\n {\n name: 'brands/1deb6297-8a57-474a-a02c-48529a3de0a0',\n displayName: 'My brand'\n },\n {\n name: 'brands/3b607982-8c06-467a-96b8-020ddc26ac83',\n displayName: 'My second brand'\n },\n {\n name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017',\n displayName: 'My thrd brand'\n }\n ]\n }\n\nRename a brand\n--------------\n\nYou can change the brand's display name. For more details, see [`brands.patch`](/business-communications/rcs-business-messaging/reference/business-communications/rest/v1/brands/patch).\n\nThe brand's display name can be changed using the `patch` operation: \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\n .patchBrand(brand.name, 'My brand new name').then((response) =\u003e {\n console.log(response.data);\n});\n```\n\nThis code returns the updated brand information: \n\n {\n name: 'brands/40bd963f-ff92-425c-b273-8f0892d2d017',\n displayName: 'My brands new name'\n }"]]