enter code here
currently the web service receives as a parameter a Json that is sent with salesforce information of opportunity / account / products. In turn, the web service generates a Json response with information from the same objects with data that must be updated. How could i update those records?
This is a Json example that gives as an answer:
{
"rCuenta": {
"RecordIdCliente": "243567890",
"codigoCliente": "CC0000671"
},
"rOppotunity": {
"RecordIdContrato": "458765349",
"NumeroContratoRenta": "0000000017",
"NumeroContratoCAM": "0000000017",
"NumeroPedido": "ND"
},
"rProductos": [
{
"RecordIdLineaCRM": "923460736",
"TotalImpuesto": 341.74000000,
"PrecioTotal": 2970.48000000,
"PorcentajeImpuesto": 13.00000000
},
{
"RecordIdLineaCRM": "834620974",
"TotalImpuesto": 233.98000000,
"PrecioTotal": 2033.84000000,
"PorcentajeImpuesto": 13.00000000
}
]
}
My end point:
HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
req.setMethod('GET');//Tipo de método
req.setEndpoint('https:...'); // Url web service
req.setHeader('Content-Type', 'application/json');
req.setHeader('Accept', 'application/json');
thanks for your help :)