Goal :
To provide a form on our website which accomplishes two things.
1. creates a ticket in zendesk while launching an lmi session
2. populates the lmi tracking0 field with zendeskticketid|external_id||true
3. Post to URL the session details back to zendesk's logmein api.
This should allow the lmi session to post the details of the interaction to the ticket created at the start of the session even though zendesk didn't create the lmi.
Problem :
LMI appears to double urlencode the | in the trackin0 value. When a ticket is born in zendesk and the lmi session created from there ( say an email arrived and we called the client ) the tracking code that's posted back to zendesk looks like this after it's been url decoded by our capture script
When zendesk gives birth
63|sdkfsklafjlkjdslk||true
When our form sets the field in the same way and posts it to lmi the resulting output during the post to url operation looks like this
When lmi is feed a session via post variables
63%7csdkfsklafjlkjdslk%7c%7ctrue
When the post to url is zendesk this causes a 400 bad request problem and the session details never get attatched to the ticket that was created at the very start of the interaction.
The form code:
<form name="channel238261599" action="https://secure.logmeinrescue.com/Customer/Download.aspx" method="post">
<input type="hidden" name="name" maxlength="64" value="<?php echo $_SESSION['firstname']." ".$_SESSION['lastname']; ?>"/>
<input type="hidden" name="comment1" maxlength="512" value="<?php echo $_SESSION['phonetocall']; ?>" />
<input type="hidden" name="comment2" maxlength="512" value="<?php echo $_SESSION['email']; ?>"/>
<input type="hidden" name="EntryID" value="238261599" />
<input type="hidden" name="tracking0" maxlength="64" value='<?php echo $data->ticket->id."|".$data->ticket->external_id."||true";?>' />
<input type="hidden" name="language" maxlength="5" />
</form>
The form is super basic, and i've also flat out copied and pasted the captured value of tracking 0 from a zendesk created session into this field. But not matter what I do if the session is setup via a form post the pipes in this value are subject to a double encoding. The output of the lmirescue logs for the 400 bad request that generate off these sessions shows that lmi is posting the value as 63%257csdkfsklafjlkjdslk%257c%257ctrue which means the % of the %7c = | from the first url encoding pass is getting encoded once again.
Does anyone have any suggestions on how to get this addressed? Or work arounds to bypass the bug?