salesforce rest api demo
// //api getPersonBasicInformation //by bruce he @RestResource(urlMapping='/user/profile/*') global with sharing class Api_user_profile{ @HttpGet global static void getPersonBasicInformation() { RestResponse res = RestContext.response; res.addHeader('Content-Type', 'application/json'); //return result obj PersonBasicInformation model = new PersonBasicInformation(); try{ ...
C#/.NET请求salesforce restful api示例
先在salesforce里写一个restful api: @RestResource(urlMapping='/user/*') global with sharing class Api_user_profile{ @HttpGet global static String getPersonBasicInformation() { List<Account> accList = DataBase.query('SELECT id,name FROM Account limit ' + Integer.valueOf(Math.floor(Math.random() * 10 + 1))); return JSON.serialize(accList); } } 再在c#/.net里调用salesforce restful api: using System; using System.Collec...