Multi environment chatbot

Description

I’m working a Zoom chatbot integration with our product, but our setup is such that every customer has it’s own dedicated server/subdomain.

We want to create an integration that we at some point can publish on your market place, but the combination of multi-server and one static webhook URL makes this a bit difficult. I was thinking of making a router-middle layer to deal with this. But we need some sort of identifier to make this solution viable.

I would like any input on what I potentially could use as an identifier or alternative solutions.

Hey @jbl,

Thanks for reaching out about your Chatbot implementation. Just to make sure we’re on the same page, are you saying that your customers have unique Zoom subdomains, or simply that they’re on different Zoom accounts?

If it’s just that they don’t belong to your Zoom account, you can use OAuth to have Zoom users outside your account authorize your Chatbot:

Having said that, please let me know if I’m misunderstanding. Any more details you can provide for clarification will help me to further assist!

Thanks,
Will

Hi, Thanks for getting back to us.

Currently, we got a working integration with Zoom. However, this relies on every customer(our customers) to setup there own Zoom app and specify their server(is own subdomain) as the “Bot endpoint URL”.

I would like to make an app where the user can click on an OAuth link(in our solution) and if they grant access to the app we will know what server/subdomain it’s should send the messages to.

To clarify, when I write subdomain, it’s related to our solution as every customer has it’s own environment/subdomain.

What I was thinking is, I’ll attach the origin in the “state” part of the Oauth URL. If the customer grants access, you will redirect to our middle layer(/auth endpoint). This middle layer will now know the origin and can forward the auth request to appropriate server.

The issue is, if the customer now writes something(to the bot in Zoom) how do I determine what server I should forward this request to? Is there some iditifier that I can use to create a mapping?

Hey @jbl,

Thanks for clarifying—and great idea.

As of right now, using a router would be the only way to do this. In terms of an identifier, you should be able to check the account_id in the payload and use that to route to the proper server.

Hope this helps!
-Will

Okey, given an access token(chat bot), can you get the account id that this access token belongs to?

Hey @jbl,

The account ID would be included in the decoded access token.

Let me know if this helps!
-Will

Hi,

When I decode the JWT I get from calling https://api.zoom.us/oauth/token, I don’t find any account ID that matches? As I understood it, the payload.accountId should be in the JWT as well? The only key-value that matches is the userId and I don’t think I want to use that one?

Here is a revoked version of the decoded JWT and an incoming event.

Decoded JWT

{
    'aud': 'https://oauth.zoom.us',
    'uid': '<1234>',
    'ver': 7,
    'auid': '<revoked>',
    'nbf': '<revoked>',
    'iss': '<revoked>',
    'gno': '<revoked>',
    'exp': '<revoked>',
    'type': '<revoked>',
    'iat': '<revoked>',
    'jti': '<revoked>'
}

Event:

 {
'event': 'bot_notification',
'payload': {'accountId': '<revoked>',
          'channelName': '<revoked>',
          'cmd': '<revoked>',
          'name': '<revoked>',
          'robotJid': '<revoked>@xmpp.zoom.us',
          'timestamp': '<revoked>',
          'toJid': '<1234>@xmpp.zoom.us',
          'userId': '<1234>',
          'userJid': '<1234>@xmpp.zoom.us',
          'userName': '<revoked>'}
}

Hi,

Just realized after posting that I got to call https://zoom.us/oauth/authorize with the authorization_code. Looks like it’s going to work, thanks for your help!

hey @jbl,

That’s correct—glad it’s working out for you!

Best,
Will

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.