Can you SET the channel with Chatbox API?

I have a dynamic page and want to allow a P2P chat but only for people who are on the dynamic page, using the chatbox API.

Could I generate a unique channel ID per dynamic page and allow users to chat in that channel?

My dynamic pages are generated by 2 unique ID’s, could I concatenate those two IDs to generate a channel ID?

How could I accomplish this?

You cannot create a Channel or set a Channel ID as of today. https://www.wix.com/corvid/reference/$w.Chatbox.html

Hi Bill, you don’t need to generate the channel ID, but the Channel ID will be created when the first user comes on the chatbox of a page. You could then add subsequent users of the same dynamic page to that channel. To accomplish this you could store the user generated chat channels of the different dynamic pages in a database.

I recently posted an example code which is for a different scenario, for business chat and not p2p as in your question. In my example, each who starts a chat, or signs up for your site, is stored in a database. Each entry in the database consists of their user ID and the chat channel that they have created. In the example, I use this to send a message to a specific user.

You have received good replies from Shan and Verbal above, so to proceed…

Make sure that you have a good read of the Wix Chatbox API that Shan already linked too, so that you can get a feeling of the code and an understanding of what it all does etc. https://www.wix.com/corvid/reference/$w.Chatbox.html

Have a read of Verbal’s previous post and look at the code example and give it a try of it on your own site.
https://www.wix.com/corvid/forum/community-discussion/code-example-sending-chat-messages-to-anyone-from-backend

There is also a Wix Corvid Chatbox example that you can have a look at too.
https://www.wix.com/corvid/forum/corvid-tips-and-updates/example-corvid-chat/p-1/dl-5e1b2dc807c1a200179327fa

If you can’t get it sorted by using the Wix API Reference, Verbal’s code example or the Corvid example, then please come back and post up any issues that you are getting along with the code that you have used (in a code block please) and any screenshots that might help to explain it more too.