AnsweredAssumed Answered

finesse gadgets.io.makerequest PUT/POST data with utf-8 charset

Question asked by michalkaska99 on Jul 19, 2016
Latest reply on Aug 9, 2016 by dekwan

Hallo,

 

I have developed a simple gadget into finesse 11 on UCCX, which use UCCX admin api to manage skill assignment on resources.

I used gadget.io.makerequest and successfully made a GET request to UCCX and successfully received data in XML format for all resources with all information.

When I tryed to do PUT request with POST_DATA where I changed some elements (mainly skil assignment) I was success only if all of the element value contained in the element values following chars [a-z, A-Z, 0-9, !@#$%^&*]. It seem all chars from lower ASCII table.

 

Unfortunately, some elements, like firstname and lastname contains chars from extended ascii. We are CZECH so we have czech letters like ěščřžýáíé in the names and when i try to PUT resource, where name contains such Czech letters, the request is processed, but czech letters are exchanged by for example \302\304 on others. Only letters from lower ascii are correctly transfered.

For example <lastaname>Káňa</lastname> element are transfered as <lastname>K\303\203\302\241\303\205\302\210a</lastname>.

When CCX receives this XML, answer, that lastname cannot be modified.

This problem occurs when I do PUT. When I do GET request to CCX admin api, I receive XML data correctly with Czech letters, but when I generate PUT, in Firefox console I see correct string with czech letters, but in packet capture I see the incorect formating

I am attaching the packet capture, where is visible the PUT Request.

I played with "charset" in content-type, but without any effect.

I also tryed to play with escape codes in the string, but this function did not converted only chars from lower ASCII.

 

Can you please help me, what should be wrong in my PUT request with gadget.io.makeRequest ?

 

 

Full XML is here:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><resource><self>http://10.164.248.90/adminapi/resource/179034</self><userID>179034</userID><firstName>Martin</firstName><lastName>Káňa</lastName><extension>954292406</extension><alias/><resourceGroup name="HD Brno"><refURL>http://10.164.248.90/adminapi/resourceGroup/2</refURL></resourceGroup><skillMap><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="H_EXT"><refURL>http://10.164.248.90/adminapi/skill/3</refURL></skillNameUriPair></skillCompetency><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="H_OST"><refURL>http://10.164.248.90/adminapi/skill/20</refURL></skillNameUriPair></skillCompetency><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="H_P84"><refURL>http://10.164.248.90/adminapi/skill/22</refURL></skillNameUriPair></skillCompetency><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="H_POL"><refURL>http://10.164.248.90/adminapi/skill/24</refURL></skillNameUriPair></skillCompetency><skillCompetency><competencelevel>5</competencelevel><skillNameUriPair name="H_VIP"><refURL>http://10.164.248.90/adminapi/skill/25</refURL></skillNameUriPair></skillCompetency></skillMap><autoAvailable>true</autoAvailable><type>1</type><team name="Brno"><refURL>http://10.164.248.90/adminapi/team/2</refURL></team><primarySupervisorOf/><secondarySupervisorOf/></resource>

 

Bez názvu.png

Outcomes