I'm connecting PRTG to our TOPdesk call management system. An alarm triggers a HTTP request to TOPdesk to generate a new supportticket. I've got that working now.

Now it's time for some formattting. I want to send HTML tags in the request. So things like <b> and <i>. PRTG keeps changing the URL that I use when I use < and >. They become { and }.

Why and how to adress this? Can't find it in the documentation or on the forum.


Article Comments

Hi,

So I took a look at the API documentation of the TOPdesk software (well documented by the way) and found a solution. So I assume that you are using the default API of the software, so you push the data to TOPdesk via Post. To get HTML tags within the post data, encode it (example website). So my example looked like:

{
	"request" : "%3Ci%3EUser123%3C%2Fi%3E%20%3Cb%3Erequested%20a%20new%20computer%3C%2Fb%3E",
	"action" : "some action",
	"caller" : {
	 	"id" : "e127ddc1-0df3-5ee4-9144-95f751bc13ee"
	},
	"operator" : {
	 	"id" : "751E0A70-5B2B-572D-8CAE-99F52651B6D0"
	},
	"operatorGroup" :  {
	 	"id" : "997F35AE-4490-5FDE-BA1C-72044499EA41"
	}
}

The "request" field will then look like: User123 requested a new computer

Best regards.


Jan, 2017 - Permalink

That's not the problem. PRTG replaces the character within the GUI. I'm not using Post btw, just the complete string in the URL.

TOPdesk reads the string litteraly so it does not really matter what I post. It's not the code, but PRTG itself.

If I use this (part of the URL): 'PRTG signaleert op %datetime dat %shortname het volgende meldt: %message. Laatste waarde is %lastvalue' it's exactly what TOPdesk will process and I get the new ticket in TOPdesk nicely with the variables filled with the actuala values.

But if I try to save this in the URL:

'PRTG signaleert op <i>%datetime</i> dat <b>%shortname</b> het volgende meldt: <i>%message</i>. Laatste waarde is <i>%lastvalue</i>'

It becomes:

'PRTG signaleert op {i}%datetime{/i} dat {b}%shortname{/b} het volgende meldt: {i}%message{/i}. Laatste waarde is {i}%lastvalue{/i)'.

And that's within in the GUI. And it's also what PRTG sends to TOPdesk, which doesn't work naturally.


Jan, 2017 - Permalink

Hi,

Unfortunately you are only able to use the brackets within the post data field. Otherwise PRTG encodes the string twice and your system can't read it most likely. So please consider to use the post data instead, you have much more options. :)


Jan, 2017 - Permalink

As it happens we are working on a API based connection. I'm no real developer but you gave me nice case to excercise. Will look in to it!


Jan, 2017 - Permalink

Reopen this old one. How did you manage to send the authorization to Topdesk?


Mar, 2018 - Permalink

@ToHe: I ended up creating a PowerShell script to invoke a request using the TOPdesk API. A notification in PRTG fires the script to create an incident in TOPdesk.

For this to work you have to create a user in TOPdesk with rights to: a) log on tot TOPdesk b) use the API c) use the items you want to edit (e.g. Incidents, Changes etc) After that you need to log in as that user in TOPdesk and create an API application password. That password can then be used in your API call to TOPdesk.


Mar, 2018 - Permalink

@CoDesk: Thank you very much! I also used this method last Friday but thought there must be a way to directly use the HTTP Action.


Mar, 2018 - Permalink

Thanks for jumping in, @CoDesk! :)


Kind regards,
Stephan Linke, Tech Support Team


Mar, 2018 - Permalink

@Stephan Linke: So you can confirm that the "HTTP Action" cannot be used with Authentication (Basic)?


Mar, 2018 - Permalink

An (plain old) HTTP request works as well as long as you use plain text. The formattting of text (HTML tags) and the contents of PRTG messages (with '%' in it for instance) kept bugging me. The API way (in combination with PowerShell) has resolved that now.


Mar, 2018 - Permalink

I thought the initial problem was using pointy brackets within the request? Anyways, there are no authentication methods to be configured for the HTTP notification. So yes, you're better off with PowerShell in this case :)

[edit] dang, too slow ;)


Kind regards,
Stephan Linke, Tech Support Team


Mar, 2018 - Permalink

Correct Stephan. Only TOPdesk requires a simple authentication string in the HTTP request, it's not a requirement for PRTG to use HTTP requests.

TOPdesk API requires Basis Auth.


Mar, 2018 - Permalink