Google Adx 판매자 정보를 교환하는 데 사용하는 API가 있습니다. 내 문제는 내가 AWS 람다 에이 데이터베이스에 자동으로 종자를 넣으려면, 일은 액세스 토큰이 만료되면 한번 만료 그때 잘 나는 API에 액세스 할 수없는 것입니다. 고객이 항상 adx 정보를 계속 얻기 위해 다시 로그인하지 못하게 할 수는 있습니다. 내가 할 수있는 것에 대한 어떤 제안이라도 대단히 감사하겠습니다. 내가 사용하는 스크립트가 포함되어 있지만 실제로는 중요하지 않습니다. 믿지 않습니다.Google Adx 판매자에게 AWS 람다를 연결하는 방법
import sys
from apiclient import sample_tools
from oauth2client import client
def main(argv):
# Authenticate and construct service.
service, _ = sample_tools.init(
argv, 'adexchangeseller', 'v2.0', __doc__, __file__,
scope='https://www.googleapis.com/auth/adexchange.seller.readonly')
try:
# Retrieve report.
result = service.accounts().reports().generate(
accountId='myaccount',
startDate='today-6d', endDate='today',
metric=['AD_REQUESTS', 'CLICKS'],
dimension=['DATE', 'WINNING_BID_RULE_NAME'],
sort=['+DATE']).execute()
# Display headers.
for header in result['headers']:
print '%25s' % header['name'],
print
# Display results.
for row in result['rows']:
for column in row:
print '%25s' % column,
print
# Display totals
for total in result['totals']:
print '%25s' % total,
print
except client.AccessTokenRefreshError:
print ('The credentials have been revoked or expired, please re-run
the '
'application to re-authorize')
if __name__ == '__main__':
main(sys.argv)
나는 또한 Python에 완전히 익숙하다. 그래서 이것은 우리가 그것을 원한 것처럼 보입니다. 하지만 클라이언트의 Adx 자격 증명을 기다리고 있으므로 100 % 확신 할 수 없습니다. 방금 토큰 만료 또는 누군가가 제안을 받았는지 알아 내려고했습니다.