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

How to call into the Direct Line REST api? #54

Closed
wbreza opened this issue Apr 5, 2016 · 16 comments
Closed

How to call into the Direct Line REST api? #54

wbreza opened this issue Apr 5, 2016 · 16 comments

Comments

@wbreza
Copy link

wbreza commented Apr 5, 2016

What is the base url for the Direct Line REST api? Reviewing the docs from http://docs.botframework.com/sdkreference/restapi-directline/#navtitle is not very clear and the demo form attempts to test with localhost.

@tomlm
Copy link
Contributor

tomlm commented Apr 5, 2016

it is api.botframework.com

@tomlm tomlm closed this as completed Apr 5, 2016
@wbreza
Copy link
Author

wbreza commented Apr 6, 2016

Thanks - I've tried the following with no success. I'm attempting to start a new conversation using the direct line REST API passing in the secret from my bots direct line secret obtained from the portal.

Request
POST - https://api.botframework.com/api/conversations
Authorization: BotConnector {secret}

Response
HTTP/1.1 404 Resource Not Found
Content-Length: 54
Content-Type: application/json
Date: Wed, 06 Apr 2016 01:56:31 GMT

{ "statusCode": 404, "message": "Resource not found" }

Am I missing anything else?

@wbreza wbreza changed the title What is the base url for the Direct Line REST api? How to call into the Direct Line REST api? Apr 6, 2016
@wbreza
Copy link
Author

wbreza commented Apr 16, 2016

@tomlm ping - See question above.

@dandriscoll
Copy link
Member

Sorry, we misspoke earlier. The hostname for the Direct Line API is directline.botframework.com. The api.botframework.com hostname is where the main Bot Connector API is located.

@alin-nemet
Copy link

Hi guys, I have a question: I have custom storage for my bot, configured through the ChatConnector, ie replaced state.botframework.com with a custom endpoint; our client uses direct client api; does direct line store data, maybe temporarily? I mean, when I start a conversation, then invoke get messages, it appears direct line gives me messages without hitting my bot connector's api getData, which makes me think it somehow has received it at some point through some interaction direct-line and my bot app; is there a way to know how the whole flow works? I also invoked get message directly for a conversationId:
userMessageSet = userConversations.GetMessages(conversationId);
and it didn't hit the bot connector from my app at all, which seems to tell that direct client (https://directline.botframework.com) somehow stored or cached the answer to a previous conversation.
Thanks.

@dandriscoll
Copy link
Member

Hi @alin-nemet, that's correct, the Direct Line service has a temporary message store so that clients can retrieve the message history. We use a cental store because the bot can send messages at any time but the client has no webhook to receive callbacks.

@alin-nemet
Copy link

Thx a lot!

@vaibhavkapur22
Copy link

And how does a Bot send a message to the Directline? What service URL should I use then?

@vaibhavkapur22
Copy link

I want to a send a message to an existing conversation between my bot and the directline client. I have the conversation ID. How do I do that? Using what service URL?

@michaelhutchful
Copy link

michaelhutchful commented Jun 23, 2017 via email

@vaibhavkapur22
Copy link

vaibhavkapur22 commented Jun 24, 2017 via email

@michaelhutchful
Copy link

michaelhutchful commented Jun 24, 2017 via email

@vaibhavkapur22
Copy link

vaibhavkapur22 commented Jun 24, 2017 via email

@michaelhutchful
Copy link

michaelhutchful commented Jun 24, 2017 via email

@vaibhavkapur22
Copy link

vaibhavkapur22 commented Jun 24, 2017 via email

@mutanttech
Copy link

Hi Guys,
I have configured a Web Chat Channel and a Direct Line Channel on Azure Bot Service. I am using the web chat control on the client side i.e. on a web page to provide a UI to users. For now I am using the Web chat control as it is i.e. included botchat.js in html served from my local server and also botchat.css which I have modified the css to give a custom look n feel. There will be requirement in future where I might have to create a custom build of Web Chat control source code, to reduce the overall size of botchat.js file and do some custom implementation as well. My question is it right way to use the UI for a website. Please share your experience and best practice for the same. Are there any other ways to do UI for Website, because I want to support the flexibility of displaying various types of responses like text, video, hero cards etc. Also, for now I am passing the secret key in the BotChat.App code, but I am confused which secret key to use, the one from WebChat Channel or DirectLine Channel. Please help me guys.
Thanks and Cheers for your efforts..

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

No branches or pull requests

7 participants