Hi,

you are talking about this?

stdClass Object(    [access_token] => 
ya29.Ci8PAz-Io9-h_0OSb_Z0OA_q6xVesQq2gAwkhnylKMptliXnblU7pAX-i5eZeuRTmQ    
[token_type] => Bearer    [expires_in] => 3600    [refresh_token] => 
1/miOiodKSrV_GAm9vcEzugUy50NrflRia2Ftc7CuOKzM)


On Tuesday, June 28, 2016 at 2:40:29 PM UTC+5, Josh Radcliff (AdWords API 
Team) wrote:
>
> Hi,
>
> Could you send me the *requestId* from your most recent attempt?
>
> Thanks,
> Josh, AdWords API Team
>
> On Tuesday, June 28, 2016 at 9:56:02 AM UTC+1, asma batool wrote:
>>
>>
>> Hi,
>>
>> I used My production account  but issue is not resolved
>>
>> Thanks
>>
>> On Friday, June 24, 2016 at 11:28:59 PM UTC+5, Josh Radcliff (AdWords API 
>> Team) wrote:
>>>
>>> Hi,
>>>
>>> I think I found the issue: the manager account in that request is a 
>>> *test* account (as you mentioned), but the client account is a 
>>> *production* (non-test) account. Please see the Test accounts section 
>>> of the managing accounts guide 
>>> <https://developers.google.com/adwords/api/docs/guides/accounts-overview#test_accounts>,
>>>  
>>> particularly this paragraph:
>>>
>>> Because test and production accounts cannot interact in any way, you 
>>>> cannot use a test account under your existing production manager account. 
>>>> To use test accounts, you'll need a new account hierarchy, with a test 
>>>> manager account as the root.
>>>
>>>
>>> The restriction also goes in the other direction: you cannot add a 
>>> production account under your test manager account.
>>>
>>> Thanks,
>>> Josh, AdWords API Team
>>>
>>> On Friday, June 24, 2016 at 4:52:12 AM UTC-4, asma batool wrote:
>>>>
>>>> Hi,
>>>>
>>>> Thanks for replying I am using Oauth credentials from the same gmail 
>>>> account which is using for MCC test account. I don't know whats the reason 
>>>> its not working.i will really great full if you will help me to resolve 
>>>> this issue
>>>>
>>>> Thanks 
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thursday, June 23, 2016 at 6:44:44 PM UTC+5, Josh Radcliff (AdWords 
>>>> API Team) wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> That error suggests that you are using OAuth credentials from an 
>>>>> account that does not have access to the manager account. The OAuth 
>>>>> credentials for each request should be as follows:
>>>>>
>>>>>    - *Extending an invitation (your example), getting pending 
>>>>>    invitations, or rescinding an invitation:* OAuth credentials for a 
>>>>>    user with access to the *manager* account
>>>>>    - *Accepting an invitation ("Client accepts" in the guide 
>>>>>    
>>>>> <https://developers.google.com/adwords/api/docs/guides/accounts-overview#linking_accounts>):*
>>>>>  OAuth 
>>>>>    credentials for a user with access to the *client* account
>>>>>
>>>>> Please double-check which user's credentials you are using and let me 
>>>>> know if you still have trouble.
>>>>>
>>>>> Thanks,
>>>>> Josh, AdWords API Team
>>>>>
>>>>> On Thursday, June 23, 2016 at 3:46:34 AM UTC-4, asma batool wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> I am able to access customer id  using your code now i want to send 
>>>>>> invitation to user for that i am using this code  
>>>>>>
>>>>>>  $managedCustomerService =
>>>>>>                 $user->GetService('ManagedCustomerService', 
>>>>>> 'v201603');
>>>>>>  $customerService = $user->GetService("CustomerService");
>>>>>>
>>>>>> $customer = $customerService->get();
>>>>>>            
>>>>>>             $linkOperations =array();
>>>>>>             $managecustomerlink =  new ManagedCustomerLink();
>>>>>>             $managecustomerlink->managerCustomerId = '5301609003';
>>>>>>             
>>>>>> $managecustomerlink->clientCustomerId=$customer->customerId;
>>>>>>             $managecustomerlink->linkStatus='PENDING';
>>>>>>             $linkOperation = new LinkOperation();
>>>>>>             $linkOperation->operator = 'ADD' ;
>>>>>>             $linkOperation->operand = $managecustomerlink ;
>>>>>>             $linkOperations = array($linkOperation);
>>>>>>
>>>>>>            // $managedCustomerService->mutateLink($linkOperations);
>>>>>>             $result = $managedCustomerService->mutateLink( 
>>>>>> $linkOperations );
>>>>>>
>>>>>> But in result i am getting this error 
>>>>>>           [ManagedCustomerServiceError.NOT_AUTHORIZED @ 
>>>>>> operations[0]]
>>>>>>
>>>>>> its a very big blockage of my work any one help me .
>>>>>>
>>>>>> Thanks in advance
>>>>>>
>>>>>>    
>>>>>>
>>>>>>
>>>>>> On Wednesday, October 14, 2015 at 8:53:06 PM UTC+5, 
>>>>>> etienne....@admobio.com wrote:
>>>>>>>
>>>>>>> Hi and thank you for your answer.
>>>>>>>
>>>>>>> My problem was that I did not request to get the customer Id based 
>>>>>>> on the OAuth credentials.
>>>>>>>
>>>>>>> Now I have this in my code which allows me to retrieve the customer 
>>>>>>> id:
>>>>>>>
>>>>>>>
>>>>>>> $user = new AdWordsUser();
>>>>>>>
>>>>>>> $user->SetOAuth2Info(array(
>>>>>>>  "client_id" => $clientId,
>>>>>>>  "client_secret" => $clientSecret,
>>>>>>>  "access_token" => $access_token,
>>>>>>>  "refresh_token" => $refresh_token
>>>>>>> ));
>>>>>>>
>>>>>>> $customerService = $user->GetService('CustomerService');
>>>>>>> $cust = $customerService->get();
>>>>>>> $user->setCustomerClientId( $cust->customerId );
>>>>>>>
>>>>>>> For now I have everything in hand to move forward. Thank you very 
>>>>>>> much for your useful information!
>>>>>>>
>>>>>>> Thank you,
>>>>>>> Etienne
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wednesday, October 14, 2015 at 9:22:46 AM UTC-4, Josh Radcliff 
>>>>>>> (AdWords API Team) wrote:
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> Is the issue that:
>>>>>>>>
>>>>>>>> a. You aren't getting back the OAuth credential from your 
>>>>>>>> *GetOAuth2Credential* call?
>>>>>>>>
>>>>>>>> OR
>>>>>>>>
>>>>>>>> b. You are getting back the OAuth credential, but you're not sure 
>>>>>>>> what to do next?
>>>>>>>>
>>>>>>>> If a), then I'd recommend going through the PHP library's OAuth2 
>>>>>>>> guide 
>>>>>>>> <https://github.com/googleads/googleads-php-lib/wiki/Using-OAuth-2.0>
>>>>>>>> .
>>>>>>>>
>>>>>>>> If b), then the Making Your First Request guide 
>>>>>>>> <https://developers.google.com/adwords/api/docs/first-request> has 
>>>>>>>> some helpful instructions for each client library. Just make sure you 
>>>>>>>> click 
>>>>>>>> the *PHP* tab, and the guide will show you how to configure the 
>>>>>>>> library and make an API request.
>>>>>>>>
>>>>>>>> Also, you mentioned that you wanted to get account information 
>>>>>>>> based on the OAuth credentials. Each user is associated with only 
>>>>>>>> *one* AdWords account (either a Manager Account 
>>>>>>>> <https://support.google.com/adwords/answer/6139186> or a regular 
>>>>>>>> AdWords account), and you can get that account's information by 
>>>>>>>> issuing a 
>>>>>>>> CustomerService.get 
>>>>>>>> <https://developers.google.com/adwords/api/docs/reference/v201509/CustomerService#get>
>>>>>>>>  call. 
>>>>>>>> This will give you back the clientCustomerId 
>>>>>>>> <https://developers.google.com/adwords/api/docs/guides/basic-concepts#soap_headers>
>>>>>>>>  (among 
>>>>>>>> other things) of the account associated with your OAuth credentials.
>>>>>>>>
>>>>>>>> Hope that helps!
>>>>>>>>
>>>>>>>> Cheers,
>>>>>>>> Josh, AdWords API Team
>>>>>>>>
>>>>>>>> On Tuesday, October 13, 2015 at 3:14:15 PM UTC-4, etienne...com 
>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> Hi Umesh and thank you for your response.
>>>>>>>>>
>>>>>>>>> looked at the link you sent me and in fact the code I have 
>>>>>>>>> included in my original publication does just that. The visitor is 
>>>>>>>>> sent to 
>>>>>>>>> an access request page to the Google server and the visitor is sent 
>>>>>>>>> back to 
>>>>>>>>> my page with an authorization code.
>>>>>>>>>
>>>>>>>>> I use this snippet of code to request access to the account of the 
>>>>>>>>> visitor:
>>>>>>>>>
>>>>>>>>> $ user = new AdWordsUser ();
>>>>>>>>> $ user-> LogAll ();
>>>>>>>>> $ user-> SetOAuth2Info (array (
>>>>>>>>> "client_id" => $ clientId,
>>>>>>>>> "client_secret" => $ clientSecret
>>>>>>>>> ));
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> // Generate an authorization callback URL Given the URL
>>>>>>>>> authUrl GetOAuth2Credential $ = ($ user, $ callbackUrl);
>>>>>>>>> // header ("Location:" $ authUrl.);
>>>>>>>>> echo '<a href="'.$authUrl.'"> </a> Start process';
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Look at my complete code in the original publication.
>>>>>>>>>
>>>>>>>>> My code, I think is good because it returns an authorization code. 
>>>>>>>>> I don't understand what I am doing wrong.
>>>>>>>>>
>>>>>>>>> I am open to any proposal.
>>>>>>>>>
>>>>>>>>> Thank you !
>>>>>>>>>
>>>>>>>>> On Friday, October 9, 2015 at 4:07:51 PM UTC-4, Umesh Dengale 
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>
>>>>>>>>>> The user has to grant access to their manager account(MCC) to get 
>>>>>>>>>> access to their AdWords accounts information. Please go through the 
>>>>>>>>>> OAuth2.0 
>>>>>>>>>> for Web Server Applications guide 
>>>>>>>>>> <https://developers.google.com/identity/protocols/OAuth2WebServer> 
>>>>>>>>>> for 
>>>>>>>>>> more details.
>>>>>>>>>>
>>>>>>>>>> Thanks,
>>>>>>>>>> Umesh, AdWords API Team.
>>>>>>>>>>
>>>>>>>>>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/6471f033-3560-4551-82c0-ad4043c2d763%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to