logo

The ConnectWise Control forum has moved to ConnectWise University! This forum has been locked and is in read-only mode. Click here for instructions on how to access the new forum.

Welcome Guest! You can not login or register.

Notification

Icon
Error

Options
Go to last post Go to first unread
jg00d3  
#1 Posted : Thursday, November 19, 2015 12:58:19 AM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

I'm trying to create a URL or use the screenconnect client on the machine to have the client invoke a request for help in the form of a chat session to a session group that doesn't have a host connected so that a trigger is generated.

I've got the trigger part working perfect, if a user clicks on the screenconnect icon in the tray and starts chatting it will send an email notification and we can respond.

Most users don't know about this icon in their tray and are used to using the existing tray icon we have for our management software on each of their machines, the option is called "Chat w/ HelpDesk". Right now, they click on that and it brings up a hipchat window and they can start to chat and we see the request. This is ok, but we need to rely on the user to tell us the machine they are on or their username in order for us to connect. I'm hoping to change the URL or the command for that "Chat w/ HelpDesk" to invoke a chat on the client end from guest w/out a host connect. That will in turn set off the trigger and we can connect to the device using screenconnect and chat w/ the user.

I'm able to send a message using this http://msp.website.com:8040/Host#All%20Machines//UID/SendMessage/Request%20For%20Assistanceut this launches a webpage which needs to be logged in which connects to the session and the message comes from the user that logs into screenconnect. The trigger isn't fired off either since the host is connected...

so basically i'm trying to get the chat window up on the clients end, w/ a message from "Guest" that says "Request For Help" which will in turn fire off a trigger and alert our helpdesk.

Anyone done anything like this before?

Thanks in advance,

jg00d3

Alexander  
#2 Posted : Monday, November 23, 2015 4:39:48 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
Well, this will avoid launching the webpage and authenticate automatically:
URL: http://msp.website.com:8040/Services/PageService.ashx/AddEventToSessions?__Authorization=Basic%20XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Method: POST
Body: ["All Sessions", ["UID"], 45, "Request For Help"]
(45 is SessionEventType.QueuedMessage; the X's are the base-64-encoded username:password for Basic authentication.)
This will still show up as being from a host, so it won't trigger the default trigger, but you could potentially edit the trigger to catch it.

Though it would probably be easier to send out an email directly:
URL: http://msp.website.com:8040/Services/MailService.ashx/SendEmail?__Authorization=Basic%20XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Method: POST
Body: ["TO", "SUBJECT", "BODY", false]
(Or true if the body is html)
In this case, you could also use GET and put the (url-encoded) arguments in the url: …/SendEmail/TO/SUBJECT/BODY/false?__Authorization=….
ScreenConnect Team
Steven  
#3 Posted : Friday, December 4, 2015 4:21:27 PM(UTC)
Steven


Rank: Guest

Medals: Level 1: Random Act of Kindness! Received One Thanks!

Joined: 5/1/2015(UTC)
Posts: 55
United States
Location: Tampa, FL

Was thanked: 12 time(s) in 8 post(s)
You could use the above one and instead of having that trigger the reponse, just make sure the message is something that prompts the user to enter their issue, such as your company name for the 'host' and then something like "Please enter a description of your issue below and one of our technicians will be responding shortly." or something like that. You could also use the Triggered Service Sample for this if you have the sessionID and just pass teh key and the session id guid like this:

http://yoursite.com/App_Extensions/{extensionguid}/service.ashx/SendMessage/{yourkey}/{sessionid}

kind of how the "SessionEventTrigger" states, but instead of the session triggering it, you'll do it remotely with your service. You could also make a trigger that checks for the 'QueuedMessage" Event.EventType where Event.Host is the hostname you use for the extension, and have that send the email for you.

The Extension Developer extension will add a link to Create Extension for Template, and once you have it created, you can edit it from the Admin > Extensions page. You wouldn't even need the SessinoEventTrigger.xml, but you could just modify that one instead of making it on the triggers page to have a quick way to disable the whole thing through the extension options.

Some help articles that help with creating this stuff:
http://help.screenconnec...nConnect_Extension_Guide
http://help.screenconnec...on_Manager_API_Reference
ScreenConnect Team
jg00d3  
#4 Posted : Friday, December 4, 2015 5:02:33 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

Hi Steven, thanks for the nudge here.

I've created the extension, "My New Extension (from Triggered Service Sample) and left just the defaults so I can test. How do I determine the {extensionguid}. Also I'm not sure where I get the {yourkey} and the {sessionid}.

Sorry for so many questions, I'm trying to jump in with both feet in the deep end.

JMG
Alexander  
#5 Posted : Wednesday, December 9, 2015 10:14:21 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
You can see the {extensionguid} in the top-right corner of the extension editor; {yourkey} just has to match what's checked in SendMessage in Service.ashx ("hipoDHsIoTPTSbPPnSCR" by default); {sessionid} is what you called UID in the url you mentioned in your original post.
ScreenConnect Team
jg00d3  
#6 Posted : Wednesday, April 6, 2016 8:28:28 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

is it possible to enter multiple Message commands for example:

<Setting Name="Message" IsServerOnly="true">
<Description>Intro.</Description>
<DefaultValue>Please standby a technician will be with you shortly.</DefaultValue>
</Setting>
<Setting Name="Message1" IsServerOnly="true">
<Description>Name.</Description>
<DefaultValue>Please let us know your name.</DefaultValue>
</Setting>

Basically what I am trying to get here is a chat window to popup and display the following:
Support: Please standby a technician will be with you shortly.
Support: Please let us know your name.


Also, when I use this URL, http://yoursite.com/App_Extensions/{extensionguid}/service.ashx/SendMessage/{yourkey}/{sessionid} the chat box comes up, but I get a webpage left over in the browser that says null. Is there a way to get the link to close the page that is loaded so that a blank page with null isn't left open in their browser?

Thanks,

jg00d3
Alexander  
#7 Posted : Wednesday, April 6, 2016 9:26:13 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
You can call AddSessionEvent multiple times to send multiple messages.

You probably want to use something other than the browser to hit that URL, to avoid opening up the page in the first place.
ScreenConnect Team
jg00d3  
#8 Posted : Wednesday, April 6, 2016 9:30:34 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

What else could I use to hit that URL besides a browser?
Alexander  
#9 Posted : Thursday, April 7, 2016 4:25:07 PM(UTC)
Alexander


Rank: Administration

Medals: Level 3: Shirt off your back! Received 25 Thanks!

Joined: 7/23/2013(UTC)
Posts: 715
Man
Location: Raleigh, NC

Was thanked: 66 time(s) in 63 post(s)
Well, you said you could have the "Chat w/ HelpDesk" option trigger a command, right? If it's on Mac/Linux, you can use curl or wget; if it's on Windows, the easiest way is probably powershell's Invoke-WebRequest.
ScreenConnect Team
jg00d3  
#10 Posted : Sunday, November 6, 2016 9:10:25 AM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

I've been using this URL
http://yoursite.com/App_Extensions/{extensionguid}/service.ashx/SendMessage/{yourkey}/{sessionid}
successfully until tonight when I upgraded to version 6 of Screenconnect.

Now when I use that URL w/ the appropriate extensionguid, yourkey and sessionid I get this message in the web browser:
{"errorType":"ArgumentException","message":"Unable to convert arguments to corresponding parameter types","detail":null}

Is there something I need to change in the URL now that I am using version 6?

Thanks,

JMG
Scott  
#11 Posted : Monday, November 7, 2016 1:52:41 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,862
United States

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
Try using POST and passing a payload instead of including them in the GET request, as shown here.
ScreenConnect Team
jg00d3  
#12 Posted : Monday, November 7, 2016 5:36:23 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

Does this need to change somewhere in the Extension itself? Or is this the way the URL is formatted?
Scott  
#13 Posted : Tuesday, November 8, 2016 2:57:44 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,862
United States

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
Not within the Extension itself but rather how it's invoked. You need to change your method of calling from GET to POST and pass the parameters within the payload.
ScreenConnect Team
jg00d3  
#14 Posted : Tuesday, November 8, 2016 4:42:41 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

I'm using the extension template "My New Extension (from Triggered Service Sample)" and following the instructions that came w/ that sample. do you have an example of how the URL would be formatted for POST using that sample extension?

These are the instructions inside of the session event trigger.xml

https://support.example.com:8040" should be replaced with your ScreenConnect url.
"8df9b1b5-e272-4b94-9a5c-5cc65b123456" should be replaced with the name of the directory under App_Extensions that contains these files.
"123456IoTPTSb123456" should be replaced with whatever you have in Service.ashx.


Are you saying the instructions are no longer valid for version 6? Is there a new set of instructions that should go along with these templates?

JMG

Edited by user Tuesday, November 8, 2016 11:22:39 PM(UTC)  | Reason: Not specified

jg00d3  
#15 Posted : Tuesday, November 8, 2016 11:28:34 PM(UTC)
jg00d3


Rank: Newbie

Joined: 11/19/2015(UTC)
Posts: 17
United States
Location: CA

Trying to invoke the web method through c# app using web request like so, but still giving server error:

request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
var postData ="['validparam1'],['validparam2']";

var data = Encoding.ASCII.GetBytes(postData);
request.ContentLength = data.Length;
using (Stream stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}

string responseContent = null;

using (WebResponse response = request.GetResponse())
{
using (Stream stream = response.GetResponseStream())
{
using (StreamReader sr = new StreamReader(stream))
{
responseContent = sr.ReadToEnd();
}
}
}

JMG


Scott  
#16 Posted : Wednesday, November 9, 2016 4:48:10 PM(UTC)
Scott


Rank: Administration

Medals: Level 4: Wise Old Owl! Received 100 Thanks!

Joined: 3/28/2014(UTC)
Posts: 2,862
United States

Thanks: 3 times
Was thanked: 351 time(s) in 303 post(s)
Try changing the content type to 'application/json'.
ScreenConnect Team
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.