instedd / aida

10 stars 1 forks source link

Given a Bot Id, how can I get programmatically the access token for the Websocket Channel? #285

Closed zontarian closed 6 years ago

zontarian commented 6 years ago

Hello we are planning to give our users the ability to choose among all the bots published on a given endpoint.

Having created an API Token in the API page, we can query our bots with https://aida-stg.instedd.org/api/v1/bots.json?access_token=<API_KEY>

Then from the JSON we can detect:

What we are missing now is the access key we have set up in the Channel/websocket page, and that is needed when setting up and subscribing to the Phoenix websocket channel. We can of course decide that the token is always a given string, and as a guideline, tell our bot creators to always set up the access key on the websocket page to always use the same string.

But an automated solution would be preferable I think. Or maybe we are missing the point, and doing things in the wrong way? Is there another way to retrieve it?

Thanks

nditada commented 6 years ago

Hi @zontarian, there is no programmatic way to get channel tokens. I think for now you'll have to instruct users to get it from the page.

zontarian commented 6 years ago

Ok, for the moment we will hard wire it in the code. Thanks