Notes
public class CustomerAPI {
public static void UpdateCustomer(){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.pathtosalesforce.com/customer.php?token=YOURTOKENHERE');
request.setMethod('PUT');
request.setBody('{"id": "25","firstName": "Emma","lastName": "Will","email": "emmawill@gmail.com","phone": "5559876543","gender": "Female","status": "active"}');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
HttpResponse response = http.send(request);
System.debug(response.getStatusCode());
System.debug(response.getStatus());
System.debug(response.getBody());
}
public static void UpdateCustomerById(String customerId){
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('https://api.pathtosalesforce.com/customer.php?token=YOURTOKENHERE');
request.setMethod('PUT');
request.setBody('{"id": "'+customerId+'","firstName": "Emma","lastName": "Anderson","email": "emmaanderson90@gmail.com","phone": "5559876543","gender": "Female","status": "active"}');
request.setHeader('Content-Type', 'application/json;charset=UTF-8');
HttpResponse response = http.send(request);
System.debug(response.getStatusCode());
System.debug(response.getStatus());
System.debug(response.getBody());
}
}