-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Comments
it is api.botframework.com |
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 Response { "statusCode": 404, "message": "Resource not found" } Am I missing anything else? |
@tomlm ping - See question above. |
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. |
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: |
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. |
Thx a lot! |
And how does a Bot send a message to the Directline? What service URL should I use then? |
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? |
Hi,
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-direct-line-3-0-concepts
Don’t worry about sending a message to direct line, just treat your bot as you would any other channel. I haven’t used Direct Line in a while, but I will assume that it will be the same URL as activity.ServiceURL. The service URL of the activity
Regards Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 23 June 2017 10:46
To: Microsoft/BotBuilder
Cc: Subscribed
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST api?(#54)
And how does a Bot send a message to the Directline? What service URL should I use then?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi,
My Scenario is this:
My Bot is connected to both the Webchat and Directline channel. I know the
details(id, name, conversationID) of the user in the Directline channel.
Once the user of the Webchat channel sends a particular message(say
"123456"), I want to send the same message to the user of Directline
Channel.
…On Fri, Jun 23, 2017 at 4:23 PM, michaelhutchful ***@***.***> wrote:
Hi,
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
framework-rest-direct-line-3-0-concepts
Don’t worry about sending a message to direct line, just treat your bot as
you would any other channel. I haven’t used Direct Line in a while, but I
will assume that it will be the same URL as activity.ServiceURL. The
service URL of the activity
Regards Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 23 June 2017 10:46
To: Microsoft/BotBuilder
Cc: Subscribed
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
api?(#54)
And how does a Bot send a message to the Directline? What service URL
should I use then?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcKeJXT469_CyLxxREnzMpByU5dniq_Vks5sG5k2gaJpZM4H_vwY>
.
|
When you send the message to direct line, use the following
Activity replyMessage = webChatActivity;
var connector = new ConnectorClient(new Uri(directLineActivity.ServiceUrl));
replyMessage.Text = "123456”;
replyMessage.Type = ActivityTypes.Message;
replyMessage.ReplyToId = directLineActivity.From.Id;
replyMessage.From = directLineActivity.Recipient;
await connector.Conversations.ReplyToActivityAsync(replyMessage);
I will use something like this. You will need to save the activity from DirectLine and use the details to send the message you receive from Webchat.
Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 24 June 2017 07:47
To: Microsoft/BotBuilder
Cc: michaelhutchful; Comment
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST api?(#54)
Hi,
My Scenario is this:
My Bot is connected to both the Webchat and Directline channel. I know the
details(id, name, conversationID) of the user in the Directline channel.
Once the user of the Webchat channel sends a particular message(say
"123456"), I want to send the same message to the user of Directline
Channel.
On Fri, Jun 23, 2017 at 4:23 PM, michaelhutchful ***@***.***> wrote:
Hi,
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
framework-rest-direct-line-3-0-concepts
Don’t worry about sending a message to direct line, just treat your bot as
you would any other channel. I haven’t used Direct Line in a while, but I
will assume that it will be the same URL as activity.ServiceURL. The
service URL of the activity
Regards Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 23 June 2017 10:46
To: Microsoft/BotBuilder
Cc: Subscribed
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
api?(#54)
And how does a Bot send a message to the Directline? What service URL
should I use then?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcKeJXT469_CyLxxREnzMpByU5dniq_Vks5sG5k2gaJpZM4H_vwY>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Hi Micheal,
Thanks for the reply, but I am not getting a message from the DirectLine
user, hence can not use the ReplyToActivity method. What I can do is use
the SendToConversation method, because I know the conversationId of the
interaction with the Directline user. This will be done once the Webchat
user enters a specific message.
But, I am error doing this. Does my Bot require Directline secret key for
sending the message?
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-send-and-receive-messages
On Sat, Jun 24, 2017 at 3:26 PM, michaelhutchful <notifications@github.com>
wrote:
… When you send the message to direct line, use the following
Activity replyMessage = webChatActivity;
var connector = new ConnectorClient(new Uri(directLineActivity.ServiceUrl)
);
replyMessage.Text = "123456”;
replyMessage.Type = ActivityTypes.Message;
replyMessage.ReplyToId = directLineActivity.From.Id;
replyMessage.From = directLineActivity.Recipient;
await connector.Conversations.ReplyToActivityAsync(replyMessage);
I will use something like this. You will need to save the activity from
DirectLine and use the details to send the message you receive from Webchat.
Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 24 June 2017 07:47
To: Microsoft/BotBuilder
Cc: michaelhutchful; Comment
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
api?(#54)
Hi,
My Scenario is this:
My Bot is connected to both the Webchat and Directline channel. I know the
details(id, name, conversationID) of the user in the Directline channel.
Once the user of the Webchat channel sends a particular message(say
"123456"), I want to send the same message to the user of Directline
Channel.
On Fri, Jun 23, 2017 at 4:23 PM, michaelhutchful ***@***.***
>
wrote:
> Hi,
>
> https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
> framework-rest-direct-line-3-0-concepts
>
> Don’t worry about sending a message to direct line, just treat your bot
as
> you would any other channel. I haven’t used Direct Line in a while, but I
> will assume that it will be the same URL as activity.ServiceURL. The
> service URL of the activity
>
> Regards Michael Hutchful
>
> Sent from Mail for Windows 10
>
> From: vkapur
> Sent: 23 June 2017 10:46
> To: Microsoft/BotBuilder
> Cc: Subscribed
> Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
> api?(#54)
>
> And how does a Bot send a message to the Directline? What service URL
> should I use then?
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#54
issuecomment-310635901>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AcKeJXT469_
CyLxxREnzMpByU5dniq_Vks5sG5k2gaJpZM4H_vwY>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcKeJTtGsRdGBSRJ0cAwGtGSQ-LtdKclks5sHN1HgaJpZM4H_vwY>
.
|
Yes direct line needs a secret key
Sent from my Windows 10 phone
From: vkapur
Sent: 24 June 2017 10:16
To: Microsoft/BotBuilder
Cc: michaelhutchful; Comment
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST api?(#54)
Hi Micheal,
Thanks for the reply, but I am not getting a message from the DirectLine
user, hence can not use the ReplyToActivity method. What I can do is use
the SendToConversation method, because I know the conversationId of the
interaction with the Directline user. This will be done once the Webchat
user enters a specific message.
But, I am error doing this. Does my Bot require Directline secret key for
sending the message?
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-send-and-receive-messages
On Sat, Jun 24, 2017 at 3:26 PM, michaelhutchful <notifications@github.com>
wrote:
When you send the message to direct line, use the following
Activity replyMessage = webChatActivity;
var connector = new ConnectorClient(new Uri(directLineActivity.ServiceUrl)
);
replyMessage.Text = "123456”;
replyMessage.Type = ActivityTypes.Message;
replyMessage.ReplyToId = directLineActivity.From.Id;
replyMessage.From = directLineActivity.Recipient;
await connector.Conversations.ReplyToActivityAsync(replyMessage);
I will use something like this. You will need to save the activity from
DirectLine and use the details to send the message you receive from Webchat.
Michael Hutchful
Sent from Mail for Windows 10
From: vkapur
Sent: 24 June 2017 07:47
To: Microsoft/BotBuilder
Cc: michaelhutchful; Comment
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
api?(#54)
Hi,
My Scenario is this:
My Bot is connected to both the Webchat and Directline channel. I know the
details(id, name, conversationID) of the user in the Directline channel.
Once the user of the Webchat channel sends a particular message(say
"123456"), I want to send the same message to the user of Directline
Channel.
On Fri, Jun 23, 2017 at 4:23 PM, michaelhutchful ***@***.***
>
wrote:
> Hi,
>
> https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
> framework-rest-direct-line-3-0-concepts
>
> Don’t worry about sending a message to direct line, just treat your bot
as
> you would any other channel. I haven’t used Direct Line in a while, but I
> will assume that it will be the same URL as activity.ServiceURL. The
> service URL of the activity
>
> Regards Michael Hutchful
>
> Sent from Mail for Windows 10
>
> From: vkapur
> Sent: 23 June 2017 10:46
> To: Microsoft/BotBuilder
> Cc: Subscribed
> Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
> api?(#54)
>
> And how does a Bot send a message to the Directline? What service URL
> should I use then?
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#54
issuecomment-310635901>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AcKeJXT469_
CyLxxREnzMpByU5dniq_Vks5sG5k2gaJpZM4H_vwY>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcKeJTtGsRdGBSRJ0cAwGtGSQ-LtdKclks5sHN1HgaJpZM4H_vwY>
.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
|
And is there any way to input that using the SendToConversation or any
other method? It comes in the header of Request Message as the
Authorization parameter, its value being "Bearer SecretKey". How do I do
that in this context?
On Sat, Jun 24, 2017 at 4:00 PM, michaelhutchful <notifications@github.com>
wrote:
… Yes direct line needs a secret key
Sent from my Windows 10 phone
From: vkapur
Sent: 24 June 2017 10:16
To: Microsoft/BotBuilder
Cc: michaelhutchful; Comment
Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
api?(#54)
Hi Micheal,
Thanks for the reply, but I am not getting a message from the DirectLine
user, hence can not use the ReplyToActivity method. What I can do is use
the SendToConversation method, because I know the conversationId of the
interaction with the Directline user. This will be done once the Webchat
user enters a specific message.
But, I am error doing this. Does my Bot require Directline secret key for
sending the message?
https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
framework-rest-connector-send-and-receive-messages
On Sat, Jun 24, 2017 at 3:26 PM, michaelhutchful ***@***.***
>
wrote:
> When you send the message to direct line, use the following
>
> Activity replyMessage = webChatActivity;
>
> var connector = new ConnectorClient(new Uri(directLineActivity.
ServiceUrl)
> );
> replyMessage.Text = "123456”;
> replyMessage.Type = ActivityTypes.Message;
> replyMessage.ReplyToId = directLineActivity.From.Id;
> replyMessage.From = directLineActivity.Recipient;
>
> await connector.Conversations.ReplyToActivityAsync(replyMessage);
>
> I will use something like this. You will need to save the activity from
> DirectLine and use the details to send the message you receive from
Webchat.
>
> Michael Hutchful
>
> Sent from Mail for Windows 10
>
> From: vkapur
> Sent: 24 June 2017 07:47
> To: Microsoft/BotBuilder
> Cc: michaelhutchful; Comment
> Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line REST
> api?(#54)
>
> Hi,
>
> My Scenario is this:
>
> My Bot is connected to both the Webchat and Directline channel. I know
the
> details(id, name, conversationID) of the user in the Directline channel.
>
> Once the user of the Webchat channel sends a particular message(say
> "123456"), I want to send the same message to the user of Directline
> Channel.
>
> On Fri, Jun 23, 2017 at 4:23 PM, michaelhutchful <
***@***.***
> >
> wrote:
>
> > Hi,
> >
> > https://docs.microsoft.com/en-us/bot-framework/rest-api/bot-
> > framework-rest-direct-line-3-0-concepts
> >
> > Don’t worry about sending a message to direct line, just treat your bot
> as
> > you would any other channel. I haven’t used Direct Line in a while,
but I
> > will assume that it will be the same URL as activity.ServiceURL. The
> > service URL of the activity
> >
> > Regards Michael Hutchful
> >
> > Sent from Mail for Windows 10
> >
> > From: vkapur
> > Sent: 23 June 2017 10:46
> > To: Microsoft/BotBuilder
> > Cc: Subscribed
> > Subject: Re: [Microsoft/BotBuilder] How to call into the Direct Line
REST
> > api?(#54)
> >
> > And how does a Bot send a message to the Directline? What service URL
> > should I use then?
> > —
> > You are receiving this because you are subscribed to this thread.
> > Reply to this email directly, view it on GitHub, or mute the thread.
> >
> > —
> > You are receiving this because you commented.
> > Reply to this email directly, view it on GitHub
> > <#54
> issuecomment-310635901>,
> > or mute the thread
> > <https://github.com/notifications/unsubscribe-auth/AcKeJXT469_
> CyLxxREnzMpByU5dniq_Vks5sG5k2gaJpZM4H_vwY>
>
> > .
> >
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#54
issuecomment-310829159>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/
AcKeJTtGsRdGBSRJ0cAwGtGSQ-LtdKclks5sHN1HgaJpZM4H_vwY>
> .
>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#54 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcKeJbELe89BvRgcEZjq5cANVVjz-Cfuks5sHOVNgaJpZM4H_vwY>
.
|
Hi Guys, |
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.
The text was updated successfully, but these errors were encountered: