Тут разобрался, посылал запрос:

https://accounts.google.com/o/oauth2/v2/auth?scope=email%20profile&state=security_token%3D138r5719ru3e1%26url%3Dhttps://oa2cb.example.com/myHome&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=хххххххх&access_type=offline

В отчет получил code. 
Далее использую code в запросе:

https://www.googleapis.com/oauth2/v4/token?code=ххххххх&client_id=ххххххх&client_secret=ххххххх&redirect_uri=https://oauth2.example.com/code&grant_type=authorization_code

В ответ получаю:
{
 "error": "redirect_uri_mismatch",
 "error_description": "Bad Request",
 "error_uri": ""
}

в ответ получаю 

On Thursday, October 27, 2016 at 10:39:20 AM UTC+3, treto...@gmail.com 
wrote:
>
> Получаю новый refresh token.
> Использую  Offline access.
> Для начала отправляю запрос вида:
>
> https://accounts.google.com/o/oauth2/v2/auth?%20scope=email%20profile&%20state=security_token%3D138r5719ru3e1%26url%3Dhttps://oa2cb.example.com/myHome&%20redirect_uri=https%3A%2F%2Foauth2.example.com%2Fcode&%20response_type=code&%20client_id=ххххххххххххх&%20access_type=offline
>  
> <https://accounts.google.com/o/oauth2/v2/auth?%20scope=email%20profile&%20state=security_token%3D138r5719ru3e1%26url%3Dhttps://oa2cb.example.com/myHome&%20redirect_uri=https%3A%2F%2Foauth2.example.com%2Fcode&%20response_type=code&%20client_id=%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85%D1%85&%20access_type=offline>
>
> Должен в ответ code прийти, но получаю :
> *400.* That’s an error.
> *Error: invalid_request* 
>
> On Wednesday, October 26, 2016 at 11:17:11 PM UTC+3, Shwetha Vastrad 
> (AdWords API Team) wrote:
>>
>> Hi,
>>
>> I'm afraid I can only respond in English. Refresh tokens can sometimes 
>> become invalid as well. There is a maximum of 50 refresh tokens that can be 
>> valid at a time. If you generate a refresh token for the 51st time, the 1st 
>> refresh token becomes invalid. Refresh tokens can also be manually revoked. 
>> I would suggest that you generate a new refresh token and use this to get 
>> an access token by following the instructions provided here 
>> <https://developers.google.com/adwords/api/docs/guides/authentication#access_and_refresh_token>
>> . 
>>
>> Let me know if this works.
>>
>> Regards,
>> Shwetha, 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/3ee8cff4-dc02-46ae-a48f-22e711ac76b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to