Botpress: How to authenticate to API in production?

Created on 17 Oct 2018  路  3Comments  路  Source: botpress/botpress

Make sure these checkboxes are checked before raising an issue, thank you!

Botpress version: 10.48.2

Channels: Messenger, Slack, web

When running locally, I can GET to for instance http://localhost:3000/api/botpress-broadcast/broadcasts 1 to see the list of broadcasts. On the production server (Heroku) though, I get the response 401 Unauthorized. I鈥檝e attempted Basic Auth with the admin username & password, but no luck.

Can you help?
Thanks
Matthew

Most helpful comment

@epaminond can you tell me how I can get it the token programmatically?

Use case: I'm wanting to use Heroku Scheduler to run a script that calls the Botpress scheduler API and creates a one-off task each day. This is intended as a work-around for #1106

All 3 comments

@mhjb , you should use Authorization: Bearer ${token} header to authenticate your request.
Usually it gets saved into bp/token key of localStorage once authorized. Hope this helps.

Thank you!

@epaminond can you tell me how I can get it the token programmatically?

Use case: I'm wanting to use Heroku Scheduler to run a script that calls the Botpress scheduler API and creates a one-off task each day. This is intended as a work-around for #1106

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rainmakerho picture rainmakerho  路  4Comments

jcampbell05 picture jcampbell05  路  6Comments

slvnperron picture slvnperron  路  7Comments

crixx picture crixx  路  5Comments

JustusNBB picture JustusNBB  路  9Comments