HttpRequest httpReq = new HttpRequest();
        HttpResponse httpRes = new HttpResponse();
        String errorMessage = '';
        if(googleCred != null && googleCred.size() > 0 && code != null){
            httpReq.setMethod('POST');
            httpReq.setEndpoint('https://oauth2.googleapis.com/token');
           // System.debug('Endpoint chck'+setEndpoint);
            httpReq.setHeader('Host', 'www.googleapis.com');
            httpReq.setHeader('Content-Type', 
'application/x-www-form-urlencoded');
            httpReq.setTimeout(12000);
            String requestBody = 
'code='+code+'&client_id='+googleCred[0].Client_ID__c+'&client_secret='+googleCred[0].Client_Secret__c;
            requestBody+= 
'&redirect_uri='+googleCred[0].Redirect_URI__c+'&grant_type='+googleCred[0].grant_type__c;
            

error

11:31:22.0 
(10858526)|CALLOUT_REQUEST|[66]|System.HttpRequest[Endpoint=https://oauth2.googleapis.com/token,
 Method=POST]
11:31:22.0 (157818650)|HEAP_ALLOCATE|[EXTERNAL]|Bytes:566
11:31:22.0 (159242113)|CALLOUT_RESPONSE|[66]|System.HttpResponse[Status=Not 
Found, StatusCode=404]
11:31:22.0 (159275031)|HEAP_ALLOCATE|[66]|Bytes:22
11:31:22.0 
(159444878)|VARIABLE_ASSIGNMENT|[66]|httpRes|"System.HttpResponse[Status=Not 
Found, StatusCode=404]"|0x464c47d1

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/af1e4d6e-7001-4b62-9d0c-d04c361b72a4%40googlegroups.com.

Reply via email to