Hi,
I assume you're using the MVC model?
I'd say have a look at the Portal documentation docs.xperience.io/.../using-support-chat to see how it's configured.
You could review the mentioned Web Part code as an example and starting point for your requests:
- Chat support request
- Initiated chat web part
- Automatically initiated chat web part
You can find these files in your Admin project under \CMS\CMSWebParts\Chat\...
Note this is all build for Portal Engine development using Web Forms!