
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-20-2021 04:00 PM
I've tried URL encoding the note, but it doesn't respect newlines. Is there a trick to this?
Labels:
- Labels:
-
General Discussion
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2022 06:46 PM
sbAYVdQu wrote:
I've tried URL encoding the note, but it doesn't respect newlines. Is there a trick to this?
So I'm having the same headache. what ive come up with so far is that URL encoding as %0A should make a new line and in the query text it does:

but doesn't reflect that in the ticket.

So I donno if the helpdesk just doesn't read it as a new line and just a space or what....

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 08:19 PM
Kal451 wrote:sbAYVdQu wrote:
I've tried URL encoding the note, but it doesn't respect newlines. Is there a trick to this?
So I'm having the same headache. what ive come up with so far is that URL encoding as %0A should make a new line and in the query text it does:
but doesn't reflect that in the ticket.
So I donno if the helpdesk just doesn't read it as a new line and just a space or what....
so, bit odd to me whos new to using any kinda api to do anything. I was sending the contents of an email as a variable and it was formatting ok.... so with a degree of "fuck it this is never going to work" just used <br> to break it up and low and behold it bloody works
Before:
Invoke-RestMethod -uri "$($HD_URI)?Action=AddNote&Key=$($HD_APIKEY)&TicketID=$($Helpdesk_Ticket)&Text=Sent%20to%20$($to)%20-%20$($body)&Username=domain\Helpdesk&Type=Internal"

After:
Invoke-RestMethod -uri "$($HD_URI)?Action=AddNote&Key=$($HD_APIKEY)&TicketID=$($Helpdesk_Ticket)&Text=Sent%20to%20$($to)%20-%20$<br>($body)&Username=domain\Helpdesk&Type=Internal"
Hopefully all of this helps someone else out later down the line
