Start bot session from webpage

Hi,

We would like to have some sort of javascript / aspx code to start an Messenger session from a webpage. I know a chatbot is not allowed to start it’s own conversation but in this case, it’s merely to followup on the Addbuddy script: a users adds Yvette to its contact list and Yvette starts a conversation right away and says ‘hello’.

is there a way to do this ?

Regards

Jeroen

[763 byte] By [JBrouwers] at [2008-2-18]
# 1
Jeroen

I think I can answer half of your question; it's fairly easy to initiate a conversation through a script. In it's simplest form just target your buddyscript server on the http-msn port with /absendquery?screenname=xxx&service=MSN&msg=routine name here

Would you mind letting me know more about the AddBuddy script? I've not heard about that one before but assumes it's a method that allows you to track the addition by a user. If that's the case then you can easily call the abovementioned URL.

There is a post about this on the old forums at https://buddyscript.colloquis.com/forums/showthread.php?s=&threadid=131

Cheers
Riaan
London

Riaanvs at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...
# 2

Hi Jeroen,

Here are the ways you can add "click to chat" links to your web page.

Code Snippet

MSN:

Starts a chat with the bot even if you are logged out
<a href="msnim:chat?contact=BOT NAME">TEXT</a>

Adds the bot to the contact list even if you are logged out
<a href="msnim:add?contact=BOT NAME">TEXT</a>

AIM:

Opens a new IM window with a screen name
<a href=aim:goim?screenname=SCREENNAME>TEXT</a>

Opens a new IM window with a screen name and a message
<a href=aim:goim?screenname=SCREENNAME&message=MESSAGE>TEXT</a>

Opens the "Add Buddy" window with a screen name to add
<a href=aim:addbuddy?screenname=SCREENNAME>TEXT</a>

Opens a chat room
<a href=aim:gochat?roomname=ROOMNAME>TEXT</a>

Opens a new IM window
<a href=aim:goim>TEXT</a>

Opens the "Add Buddy" window with a screen and a group name to add
<a href=aim:addbuddy?screenname=SCREENNAME&groupname=GROUPNAME>TEXT</a>

To change someone's buddy icon when they click on the link
<a href=aim:buddyicon?src=BUDDYICONURL>TEXT</a>

To open or receive someone's shared files
<a href=aim:getfile?screenname=SCREENNAME>TEXT</a>

TomRagle at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...
# 3

Code Snippet

MSN:

Starts a chat with the bot even if you are logged out
<a href="msnim:chat?contact=BOT NAME">TEXT</a>

Adds the bot to the contact list even if you are logged out
<a href="msnim:add?contact=BOT NAME">TEXT</a>

I believe it is not totally true what you post there. This will not start a chat when you are logged out, and it will definately not add the bot to your contact list if you are logged out. To let this work, you will need to be logged in. If you are not logged in at the time you click the link, this will start messenger, and nothing more.
Btw, you will need to replace BOT NAME is this code with the actual e-mail address of the bot, not the name.
JeroenBransen-J-Thread at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...
# 4
Is there someone who can tell me exactly how absendquery is invoked and returns its results?
If I invoke:

http://localhost:8053/absendquery?screenname=empyre700@hotmail.com&service=MSN&msg=hoi&buddyid=AutomatedAgent

directly from the browser, nothing happens. According to the colloquis documentation a message should be send to the agent containing hoi, and empyre700@hotmail should recieve the result.

If anyone can tell me why this doesn't work, I'd be very pleased.

BartRiepe at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...
# 5
Hi there

Ensure that you added the HTTP option to your buddy's configuration, and make a note of the port ... in the example above, it should be 8053.

Then check if you can actually chat to your buddy by going to port 8053 on your server. Remove the BuddyID from the above.

Lastly, type in "hoi" in a chat with your buddy on MSN and see if you actually get a response.

Riaan

Riaanvs at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...
# 6
That part was already working ^^

The point is, you should be able to send requests to the buddy (via GET), then have the buddy do something (whether saying something to a specific user, assigning global variables, or do something else) based on the match of the message in your input. This doesn't work from the webinterface to msn, when I send a command via the above request (even without buddyID), the buddy doesn't respond in any way.

EDIT: Nevermind, I figured it out, all weird characters should be HTML encoded, so you can't simply type in email adresses like empyre700@hotmail.com. As another note, buddyid IS required, at least in my case.

Just to help out other people, a sample call to the http-msm:

http://localhost:8055/absendquery?screenname=empyre700%40hotmail%2ecom&service=MSN&buddyid=AutomatedAgent&msg=hoi

Screenname = The email adress of the one who virtually send the message (who would have typed it in msn messenger).
Service = The service you use, probably MSN.
Buddyid = Not yet figured out how te set this precisely, but default is AutomatedAgent.
Msg = the message which the user would have send. Or a call to a function, of which I'm not yet sure what the syntax is Smile.

BartRiepe at 2007-10-3 > top of Msdn Tech,Windows Live Developer Forums,Windows Live Agents Development...

Windows Live Developer Forums

Site Classified