• sharan kumar Kolluru
  • NEWBIE
  • 30 Points
  • Member since 2019
  • Salesforce Developer


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
You have one or more certificates in your Salesforce org Salesforce 00D0o0000016PXb that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

   - SelfSignedCert_25Jun2019_135552, Self-Signed, expires on 6/25/2020. Warning: This certificate will expire in 60 day(s).

As far as I know I have finished all maintenance exams. I am not sure why I have recieved this. I am not sure how to figure out this. I need helpppppppp
Hi Friends,

I Have a Requirement, I Need to Deserialize the JSON Response and Store in to custom Object.

My JSON Response Format: 
{
    "_links": {
        "_self": "/proxy",
        "_parent": "/"
    },
    "ip": "92.252.241.11",
    "port": 4145,
    "protocol": "socks4",
    "anonymity": "high anonymity",
    "lastTested": "2020-06-19 09:55:54",
    "allowsRefererHeader": true,
    "allowsUserAgentHeader": true,
    "allowsCustomHeaders": true,
    "allowsCookies": true,
    "allowsPost": true,
    "allowsHttps": true,
    "country": "RU",
    "connectTime": "3.312",
    "downloadSpeed": "50.000",
    "secondsToFirstByte": "3.472",
    "uptime": "64.125"
}

To Achieve this Requirement, I Have created a custom Object as Proxy_Server__c and Some Custom Fields to store the Response.

But I'm getting an Error as Compile Error: Incompatible types since an instance of Map<String,Object> is never an instance of List<Object> at line 19 column 34

public class GetProxyDataCallout {
    public static HttpResponse makeGetProxyDataCallout(){
        Http http = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://api.getproxylist.com/proxy');
        request.setMethod('GET');
        HttpResponse response = http.send(request);
        System.debug(response);
        System.debug(response.getBody());
        
        List<Proxy_Server__c> upsertGetProxyList = new List<Proxy_Server__c>();
     
        //Deserialize The JSON Response in to List of Objects
        Map<String, Object> results = (Map<String, Object>)JSON.deserializeUntyped(response.getBody());
        System.debug(results);
        
        List<Object> proxyList = (List<Object>)results;
        System.debug(proxyList);
        
        for(Object proxyListobj : proxyList){
            System.debug(proxyListobj);
            Map<string, Object> proxyAddress = (Map<string, Object>)proxyListObj;
            System.debug(proxyAddress.get('ip'));
            Proxy_Server__c proxyIpList = new Proxy_Server__c();
            proxyIpList.Name = (String)proxyAddress.get('country');
            proxyIpList.IP_Address__c = (String)proxyAddress.get('ip');
            proxyIpList.Port__c = (String)proxyAddress.get('port');
            proxyIpList.Last_Update__c = (String)proxyAddress.get('lastTested');
            proxyIpList.Proxy_Level__c = (String)proxyAddress.get('anonymity');
            proxyIpList.Provider__c = 'Get Proxy';
            proxyIpList.Proxy_Provider__c = string.isNotBlank(proxyServerId)?proxyServerId:'';
            
            upsertGetProxyList.add(proxyIpList);  
        }
        
        UPSERT upsertGetProxyList;
        return response;
    }

}


Please Help me to resolve the issue.
Thanks In Advance.
You have one or more certificates in your Salesforce org Salesforce 00D0o0000016PXb that will expire soon. Review the list below and visit Certificate and Key Management from Setup to make an update.

   - SelfSignedCert_25Jun2019_135552, Self-Signed, expires on 6/25/2020. Warning: This certificate will expire in 60 day(s).

As far as I know I have finished all maintenance exams. I am not sure why I have recieved this. I am not sure how to figure out this. I need helpppppppp