Recently I've been trying to write scripts that use the rocket chat SDK (for example, here is a sample from the examples.js file : bot.adapters.message.api.post('users.setAvatar'...)
Unfortunately, it doesn't seem to work because the bot is unable to login to the API. The error I keep getting when the bot starts or when I try to run an API command often looks like this :
info: [API] Logging in bot21
debug: [API] POST: login
{ status: 'error', message: 'API endpoint does not exist' }
error: [API] POST error (login):
Error: [API] Login failed for bot21
at /root/lockerbot/node_modules/@rocket.chat/sdk/dist/lib/api.js:189:19
at Generator.next (<anonymous>)
at fulfilled (/root/lockerbot/node_modules/@rocket.chat/sdk/dist/lib/api.js:4:58)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
Also, it may help to know that I've had no problem running curl commands manually through the bot's userID and XAuthtoken.
Does anyone else run into this issue ? Any idea on how to fix it ?
Hello,
Recently I've been trying to write scripts that use the rocket chat SDK (for example, here is a sample from the examples.js file :
bot.adapters.message.api.post('users.setAvatar'
...)Unfortunately, it doesn't seem to work because the bot is unable to login to the API. The error I keep getting when the bot starts or when I try to run an API command often looks like this :
Also, it may help to know that I've had no problem running curl commands manually through the bot's userID and XAuthtoken.
Does anyone else run into this issue ? Any idea on how to fix it ?
Thank you.