Токен авторизации

118 views
Skip to first unread message

Oleg Sidorov

unread,
Apr 21, 2017, 5:42:38 AM4/21/17
to AdWords API Forum
Добрый день!

Цель задачи: при изменении цены товара в CRM, вызывать API AdWords для обновления цены.
Могу ли я полученный токен доступа сохранить в моём приложении и использовать его через PHP библиотеку AdWords для выполнения методов API? Будет ли он автоматически обновляться?
Или после истечения срока действия токена, необходимо получать новый и менять его в приложении?

С уважением,
Олег

Sreelakshmi Sasidharan (AdWords API Team)

unread,
Apr 21, 2017, 12:22:42 PM4/21/17
to AdWords API Forum
Hi,

Unfortunately, I can only respond in English.

The access tokens are short lived (an hour) and if you try to save it and make an API call once that expires, the call will not be successful. Instead, you could save the refresh token which is long lived and use that refresh token for generating a new access token (if already expired) for each API calls. Are you using our PHP client library? If so, you could follow the instructions in the linked document and update the refresh token in the adsapi_php.ini file and that should take care of renewing the access token for all the future calls. The document about OAuth should also be helpful for you.

Please let me know if you have any additional questions.

Thanks,
Sreelakshmi, AdWords API Team
Reply all
Reply to author
Forward
0 new messages