Hi Takeshi, Get refresh toke URL is not this 
https://accounts.google.com/o/oauth2/*****. thanks.

Takeshi Hagikura (AdWords API Team)於 2013年8月23日星期五UTC+8下午1時05分23秒寫道:
>
> Hi Jur,
>
> I got it. 
>
> > I click accept and get :
> > Please copy this code, switch to your application and paste it there:
> In that step, when you get is an authorization code (kind of one time 
> password) that can be used to generate access token (and refresh token when 
> offline-mode).
> In GetRefreshToken.php, the line 65 
> <https://code.google.com/p/google-api-adwords-php/source/browse/examples/AdWords/Auth/GetRefreshToken.php#65>
>  does 
> that. 
> Then, refresh token should be returned.
>
> In the auth.ini, please use that refresh token, not the authorization 
> code. 
>
> Hope this helps. 
> Best,
> - Takeshi, 
>
> On Thursday, August 22, 2013 4:44:54 PM UTC+9, Jur wrote:
>>
>> Hello Takeshi,
>>
>> I used my MCC account to generate the client_id and client_secret.
>>
>>  Client ID for installed applications 
>>   Client ID:xxx
>> .apps.googleusercontent.com
>>   Client secret: 
>> xxx
>>   Redirect URIs: urn:ietf:wg:oauth:2.0:oob http://localhost
>> The GetRefreshToken.php didn't give me a refresh token immediately it 
>> gave me this :
>>
>> Log in to your AdWords account and open the following URL: 
>> https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=xx.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fadwords.google.com%2Fapi%2Fadwords%2F&access_type=offline
>>  
>> After approving the token enter the authorization code here:  
>>
>> After I go to the link a get a page with:
>> This app would like to:
>> Manage your AdWords campaigns
>> Adsys and Google will use this information in accordance with their 
>> respective terms of service and privacy policies.
>>
>> I click accept and get :
>> Please copy this code, switch to your application and paste it there:
>>
>> With the token there.
>>
>> I put that token in auth,ini
>>
>> Regards,
>>
>> Jur
>>
>>
>> Op donderdag 22 augustus 2013 07:39:26 UTC+2 schreef Takeshi Hagikura 
>> (AdWords API Team):
>>>
>>> Hi Jur,
>>>
>>> The SOAP xml looks right to me. 
>>>
>>> So next, what account did you use in api console to retrieve your client 
>>> id and client secret?
>>> Also did you replace the refresh_token in your auth.ini by the refresh 
>>> token returned in GetRefreshToken.php?
>>>
>>> Best,
>>> - Takeshi, 
>>>
>>> On Wednesday, August 21, 2013 11:05:34 PM UTC+9, Jur wrote:
>>>>
>>>> Hello Takeshi,
>>>>
>>>> I think the error is in this part of the code in the file 
>>>> /Common/Lib/AdsSoapClient.php:
>>>> $response = parent::__soapCall($function_name, $arguments, $options,
>>>>           $input_headers, $output_headers);
>>>>
>>>> Hope you can help me!
>>>>
>>>> Regards,
>>>>
>>>> Jur
>>>>
>>>> Op woensdag 21 augustus 2013 13:53:06 UTC+2 schreef Jur:
>>>>>
>>>>> Hello Takeshi,
>>>>>
>>>>> I did find it a strange request, but I did send it anyway :-)
>>>>> Thanks for removing the message.
>>>>>
>>>>> I think this is the XML send :
>>>>>
>>>>> <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope 
>>>>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
>>>>> xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201306";><SOAP-ENV:Header><ns1:RequestHeader><ns1:clientCustomerId>823-418-1279</ns1:clientCustomerId><ns1:developerToken>xxxx</ns1:developerToken><ns1:userAgent>RIS_Online_Conversion
>>>>>  (AwApi-PHP/4.4.0, Common-PHP/5.0.0, 
>>>>> PHP/5.3.3)</ns1:userAgent></ns1:RequestHeader></SOAP-ENV:Header><SOAP-ENV:Body><ns1:get><ns1:serviceSelector><ns1:fields>Id</ns1:fields><ns1:fields>Name</ns1:fields><ns1:ordering><ns1:field>Name</ns1:field><ns1:sortOrder>ASCENDING</ns1:sortOrder></ns1:ordering><ns1:paging><ns1:startIndex>0</ns1:startIndex><ns1:numberResults>500</ns1:numberResults></ns1:paging></ns1:serviceSelector></ns1:get></SOAP-ENV:Body></SOAP-ENV:Envelope>
>>>>>
>>>>>
>>>>> Op dinsdag 20 augustus 2013 17:37:50 UTC+2 schreef Takeshi Hagikura 
>>>>> (AdWords API Team):
>>>>>>
>>>>>> Hi Jur,
>>>>>>
>>>>>> Sorry I didn't mean to post client id and client secret. 
>>>>>> I wanted to know what account did use to get your client id and 
>>>>>> client secret.
>>>>>>
>>>>>> If you used your MCC account under which your test account is in or 
>>>>>> the test account itself for getting client id and secret,
>>>>>> the CampaignService.get should work. 
>>>>>>
>>>>>> Also I wanted to confirm the xml request log for CampaignService.get. 
>>>>>> Specifically clientCustomerId (for your test account) was included in 
>>>>>> the soap header. 
>>>>>>
>>>>>> Best,
>>>>>> - Takeshi,
>>>>>>
>>>>>> On Tuesday, August 20, 2013 8:54:23 PM UTC+9, Jur wrote:
>>>>>>>
>>>>>>> Hello Takeshi,
>>>>>>>
>>>>>>> Clientid: xxxxxxx
>>>>>>> Client_secreat:xxxxxxx
>>>>>>>
>>>>>>> I use the standard getCampainsExample function:
>>>>>>>
>>>>>>> // Include the AdWordsUser
>>>>>>> require_once LIB_PATH . '/AdWordsUser.php';
>>>>>>>
>>>>>>> function GetCampaignsExample(AdWordsUser $user) {
>>>>>>>   // Get the service, which loads the required classes.
>>>>>>>   $campaignService = $user->GetService('CampaignService', 
>>>>>>> ADWORDS_VERSION);
>>>>>>>
>>>>>>>   // Create selector.
>>>>>>>   $selector = new Selector();
>>>>>>>   $selector->fields = array('Id', 'Name');
>>>>>>>   $selector->ordering[] = new OrderBy('Name', 'ASCENDING');
>>>>>>>
>>>>>>>   // Create paging controls.
>>>>>>>   $selector->paging = new Paging(0, 
>>>>>>> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>>>>>>>
>>>>>>>   do {
>>>>>>>     // Make the get request.
>>>>>>>     $page = $campaignService->get($selector);
>>>>>>>
>>>>>>>     // Display results.
>>>>>>>     if (isset($page->entries)) {
>>>>>>>       foreach ($page->entries as $campaign) {
>>>>>>>         printf("Campaign with name '%s' and ID '%s' was found.\n",
>>>>>>>             $campaign->name, $campaign->id);
>>>>>>>       }
>>>>>>>     } else {
>>>>>>>       print "No campaigns were found.\n";
>>>>>>>     }
>>>>>>>
>>>>>>>     // Advance the paging index.
>>>>>>>     $selector->paging->startIndex += 
>>>>>>> AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>>>>>>>   } while ($page->totalNumEntries > $selector->paging->startIndex);
>>>>>>> }
>>>>>>>
>>>>>>> try {
>>>>>>>   // Get AdWordsUser from credentials in "../auth.ini"
>>>>>>>   // relative to the AdWordsUser.php file's directory.
>>>>>>>   $user = new AdWordsUser();
>>>>>>>   // Log every SOAP XML request and response.
>>>>>>>   $user->LogAll();
>>>>>>>   
>>>>>>>   // Run the example.
>>>>>>>   GetCampaignsExample($user);
>>>>>>> } catch (Exception $e) {
>>>>>>> print_r($e);
>>>>>>>   printf("An error has occurred: %s\n", $e->getMessage());
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> Op maandag 19 augustus 2013 10:30:24 UTC+2 schreef Takeshi Hagikura 
>>>>>>> (AdWords API Team):
>>>>>>>>
>>>>>>>> Hi Jur, 
>>>>>>>>
>>>>>>>> What clientId and clientSecret are you passing to the script when 
>>>>>>>> you run the GetRefreshToken.php script?
>>>>>>>> And can you please share the request xml when you run the 
>>>>>>>> GetCampaign (except for the sensitive info)? 
>>>>>>>>
>>>>>>>> Best,
>>>>>>>> - Takeshi, AdWords API Team
>>>>>>>>
>>>>>>>>
>>>>>>>> On Friday, August 9, 2013 1:15:48 AM UTC+9, Jur wrote:
>>>>>>>>>
>>>>>>>>> Hello Guys,
>>>>>>>>>  
>>>>>>>>> I'm working on my first Google Adwords API application, but I 
>>>>>>>>> can't get passed the oauth2 verification.
>>>>>>>>> I could get a refresh_token with the GetRefreshToken.php script, 
>>>>>>>>> but I get the error : An error has occurred: { "error" : 
>>>>>>>>> "invalid_grant" } 
>>>>>>>>> when I request a list of campaines in my test account.
>>>>>>>>>  
>>>>>>>>> Hope someone can help me out in the right direction.
>>>>>>>>>  
>>>>>>>>> Regards,
>>>>>>>>>  
>>>>>>>>> Jur
>>>>>>>>>  
>>>>>>>>> MMC id : 916-243-9387
>>>>>>>>>
>>>>>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to