[Vtigercrm-developers] [API]Problem with '&' in json

Sukhdev Mohan s.mohan at myti.it
Mon Apr 19 08:46:20 GMT 2021


That solved. 
IMHO it’s time to redesign the api to be completely RESTFUL not some workaround to use FORM URL ENCODE and have json in a field.

Best Regards,
Sukhdev Mohan | Software Developer







> Il giorno 19 apr 2021, alle ore 10:18, Sutharsan J <ajstharsan at gmail.com> ha scritto:
> 
> Hi
> 
> There can't be issue in api as we use it several times, but using cURL. May be url encoding should be done before json encoding, probably urlencode each field separately the build json. Did you try that?
> 
> 
> Thanks
> Sutharsan jeganathan 
> 
> On Sun, 18 Apr 2021 at 03:38 Sukhdev Mohan <s.mohan at myti.it <mailto:s.mohan at myti.it>> wrote:
> Tried that, not working
> 
> Il sab 17 apr 2021, 23:57 Joe Bordes <joe at tsolucio.com <mailto:joe at tsolucio.com>> ha scritto:
> try url encoding the json string
> 
> 
> 
> On 17/4/21 23:21, Sukhdev Mohan wrote:
>> Hello All,
>> 
>> I’m using pentane data integration and importing data into vtiger v7 through rest API’s. 
>> I’m doing POST request (form-url-encode) and in the body I’ve this
>> elementType=Products&element={productname: “”, productcode: “”, description: “"}
>> 
>> Sometimes in the productname or description there is a “&” and as you can guess this breaks the json resulting in error. I’ve tried sending plain text and it doesn’t work either. How can I proceed? 
>> 
>> 
>> Probably this is a bug and we need to re-design the API’s expecting the body as a json possible implementation:
>> 
>> {
>> 	element: “ELEMENT”,
>> 	data: {
>> 	}
>> }
>> 
>> Best Regards,
>> Sukhdev Mohan | Software Developer
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> http://www.vtiger.com/ <http://www.vtiger.com/>-- 
> Un saludo
> Joe
> TSolucio
> 
> JPL TSolució, S.L. garantiza la confidencialidad de los datos que obran en su poder y según lo estipulado por la LOPD 
> (Ley Orgánica 15/1999 de 13 de diciembre de Protección de Datos de Carácter Personal). Este mensaje se dirige 
> exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es vd. el destinatario 
> indicado, queda notificado de que la lectura, utilización, divulgación y/o copia sin autorización está prohibida en 
> virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente 
> por esta misma vía y proceda a su destrucción. El correo electrónico vía Internet no permite asegurar la confidencialidad 
> de los mensajes que se transmiten ni su integridad o correcta recepción. JPL TSolució, S.L. no asume ninguna 
> responsabilidad por estas circunstancias.
> _______________________________________________
> http://www.vtiger.com/ <http://www.vtiger.com/>_______________________________________________
> http://www.vtiger.com/ <http://www.vtiger.com/>-- 
> Development Manager
> Radus28 Software Solution
> 
> 123, Level 2, Mc Larens Building
> Baudhaloka Mw.
> Colombo 04
> Sri Lanka
> M : +94773795291
> E  : sutharsan at radus28.com <mailto:sutharsan at radus28.com>
> W : www.radus28.com <http://www.radus28.com/><logo_web.png>_______________________________________________
> http://www.vtiger.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20210419/17cc630c/attachment.html>


More information about the vtigercrm-developers mailing list