question

mholbrgr avatar image
0 Likes"
mholbrgr asked

Client Alerts - Invalid characters in session token/id/data parameters

I have made a console app in C# and .NET (Visual Studio 2012) to test the client alerts system and sometimes it works perfectly, I use the apiContext to call for a ClientAlertsToken, I use the token to login to client alerts, and then start periodically calling GetUserAlerts, replacing the sessionData with the string that came in the previous message. I should note I am parsing the JSON response with JSON.NET: JsonConvert. DeserializeObject[dynamic](jsonData); It all works until I receive a string value that contains a '+' character in it. Then when I pass that back as a value for the SessionData or SessionID it fails, because of that specific character. Is this a problem with server compression? Do I need to somehow escape certain special characters? Please fill me in, thanks!
client alertssessionidinvalid tokenspecial characters
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
mholbrgr avatar image
0 Likes"
mholbrgr answered
I solved the issue. The plus signs show up as blank spaces inside a URL, so I used System.Net.WebUtility.UrlEncode() on just the token/id/session data strings to sanitize them.
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.