• sheetal_acs
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 0

The example is not working when I gives the URL of my site in Endpoint.

Is there any special setting required on server?

Unable to fetch the data.

public class AccountUpdater {

  //Future annotation to mark the method as async.
  public static void updateAccount(String id, String name) {

    //construct an HTTP request
    HttpRequest req = new HttpRequest();

    //send the request
    Http http = new Http();
    HttpResponse res = http.send(req);

    //check the response
    if (res.getStatusCode() == 200) {

      //update account
      Account acc = new Account(Id=id);
      acc.Description = res.getBody();
      update acc;
    } else {
      System.debug('Callout failed: ' + res);

 Description is blank. I have used trigger to call this class. and also have added the URL in Remote site. I have checked  Apex Job,it shows job status Completed. I am trying from developer account