You need to sign in to do that
Don't have an account?
RICARDO PALMA
Sending JSON parameters.
Hi,
I'm doing an integration with a third party and I have to send the accid to the third party to get some information back. I got the result when I type the accid, but I what I really need to do is set up a params as variable not a literal.
Here is what I want to do:
This doesn't work.
Just for testing I'm setting up manually the accid but this value is going to be the accid on the opportunity. The values is going to different base on the opportunity.
string accid = "CtjSFlLYIls4-gAe";
string s = '{"jsonrpc": "2.0","id": 1,"method": "acct.phone.get","params": [accid]}';
I got an error: {"jsonrpc":"2.0","error":{"message":"invalid JSON in request body","code":-32700}}
It looks like I'm not using the right JSON format to set a parameter.
But when I type the id on the params I got the information back.
string s = '{"jsonrpc": "2.0","id": 1,"method": "acct.phone.get","params": ["CtjSFlLYIls4-gAe"]}';
I hope someone can help me.
Thanks.
I'm doing an integration with a third party and I have to send the accid to the third party to get some information back. I got the result when I type the accid, but I what I really need to do is set up a params as variable not a literal.
Here is what I want to do:
This doesn't work.
Just for testing I'm setting up manually the accid but this value is going to be the accid on the opportunity. The values is going to different base on the opportunity.
string accid = "CtjSFlLYIls4-gAe";
string s = '{"jsonrpc": "2.0","id": 1,"method": "acct.phone.get","params": [accid]}';
I got an error: {"jsonrpc":"2.0","error":{"message":"invalid JSON in request body","code":-32700}}
It looks like I'm not using the right JSON format to set a parameter.
But when I type the id on the params I got the information back.
string s = '{"jsonrpc": "2.0","id": 1,"method": "acct.phone.get","params": ["CtjSFlLYIls4-gAe"]}';
I hope someone can help me.
Thanks.
String a = 'cd';
String f = 'b' + a + 'e'; //now f will have bcde
so for your case.
string accid = "CtjSFlLYIls4-gAe";
string s = '{"jsonrpc": "2.0","id": 1,"method": "acct.phone.get","params": [' + accid + ']}';
It works great!!!
Are you able to invoke json-rpc from Salesforce? Can you share some details pls
Regards
Sumit
Thank you for your reply. We have a different issue. We are trying to do JSON RPC over TCP.
Regards
Sumit