Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slack adapter and hubot-apiai: sessionId Parameter #3

Open
dakky opened this issue Oct 5, 2017 · 7 comments
Open

Slack adapter and hubot-apiai: sessionId Parameter #3

dakky opened this issue Oct 5, 2017 · 7 comments

Comments

@dakky
Copy link

dakky commented Oct 5, 2017

Hello:

when using the slackadapter and api.ai i get the following error:
[Thu Oct 05 2017 12:10:00 GMT+0200 (CEST)] DEBUG Calling API.AI with 'hello' and session undefined [...] statusCode: 400, responseBody: '{\n "id": "xxx-xxxx-xxxx",\n "timestamp": "2017-10-05T10:09:12.366Z",\n "lang": "en",\n "status": {\n "code": 400,\n "errorType": "bad_request",\n "errorDetails": "Required \'sessionId\' parameter is empty."\n }\n}', name: 'ServerError', message: 'Wrong response status code.' }

when modifing the following line:

else if robot.adapterName == 'slack'

to = "slackx" and forcing the fallback mechanism, it works fine. Any idea whats wrong there?

@ojacques
Copy link
Owner

Thanks for reporting this @dakky ! I am not sure what's wrong. If you find out, a pull request would be great!

@divyangjp
Copy link

@ojacques @dakky When it's the first message, thread_ts value is undefined. If you start a thread with the message, thread_ts gets populated, and hence the error goes away.

@divyangjp
Copy link

divyangjp commented Nov 17, 2017

@ojacques I assume flowdock assigns thread_ts value even to the messages without the threads.
Maybe this needs a fix for Slack

@ojacques
Copy link
Owner

@divyangjp I don't use Slack, so, I can't tell. However, if you find a way to get this right, that'd be really nice...

@adriantan08
Copy link

Hi. I think there might be some changes in the response object Slack sends. rawMessage.thread_ts is no longer existing.

Could be rawMessage.ts?

image

@kavya05
Copy link

kavya05 commented Jan 29, 2018

@adriantan08 did the change work for you? i mean are u able to integrate with slack?

@kavya05
Copy link

kavya05 commented Jan 29, 2018

hey guys it worked for me when i made these changes
image
but its creating a mess by calling the same statement again and again, its not a good practice to use this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants