1 Reply Latest reply on Apr 15, 2015 2:10 PM by littleprawn

    API Rest  json vs xml

    gaetan.esnault

      I have a problem with API Rest and the request XML or Json.

      For Example:

      JSON Resquest :

      curl "http://.be/helpdesk/WebObjects/Helpdesk.woa/ra/Clients/1506?apikey=XXxxXX"



      {"id":1506,"type":"Client","email":"IT@.be","firstName":"IT (
      "lastName":")","notes":null,"phone":null,"phone2":null,"department":null,"location":null,"room":null,"username":"IT","companyName":null}

      It's OK

      XML request :
      curl "http://.be/helpdesk/WebObjects/Helpdesk.woa/ra/Clients.xml/1506?apikey=XXxxXX"


      [{"id":1962,"type":"Client","email":"

      XXXXXX

      "firstName":"IT ( "lastName":")","notes":null,"phone":null,"phone2":null,"department":null,"location":null,"room":null,"username":"IT","companyName
      ":null}]

      it's not the same response.

      XML Request with qualifier:


      curl "http://.be/helpdesk/WebObjects/Helpdesk.woa/ra/Clients.xml?qualifier=(email%20like%20'IT)&apikey=XXxxXX"


        <?xml version="1.0" encoding="UTF-8"?>
      <Clients type="Client">
      <Client id="1506" type="Client">
      <email>IT@.be</email>
      <firstName>IT (
      </firstName>
      <lastName>)</lastName>
      <notes nil="true"/>
      <phone nil="true"/>
      <phone2 nil="true"/>
      <department nil="true"/>
      <location nil="true"/>
      <room nil="true"/>
      <username>IT</username>
      <companyName nil="true"/>
      </Client>
      </Clients>

      it's ok.

      what's happened?
      my request are not correct?

      thank's you for your help