• Harshad Chauhan
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi All,

I am new to Salesforce integration. I have to write an invocable method that will get records from an external system. I have endpoint URL and parameter. I want to store the result in wrapper response.
I have tried this but was not able to get the exact code.

public class fetchdetails{
@InvocableMethod
public static List<Results> FetchZillowEstimation(List<Results> address)
    {
    HTTP h = new HTTP();
    HTTPRequest req= new HTTPRequest();
    req.setEndpoint('https://api.getfurnituredata.com/?address=test');
    req.setMethod('GET');
    HTTPResponse res= h.send(req);
    if (res.getStatusCode() == 200) {
            String jsonInput =res.getBody();;
        }
    System.debug(res.getBody());
    String jsonInput =res.getBody();
    Map<String,Object> m =(Map<String, Object>) json.deserializeUntyped(jsonInput);
    system.debug(m);
    }
    
      

}
global class Results{
@InvocableMethod
global decimal name;

}