Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/stats 호출 시, 잘못된 파라미터 형식입니다. #976

Open
hwanython opened this issue Jul 13, 2024 · 0 comments
Open

/stats 호출 시, 잘못된 파라미터 형식입니다. #976

hwanython opened this issue Jul 13, 2024 · 0 comments

Comments

@hwanython
Copy link

안녕하세요 , /stats를 호출하고자 합니다.

근데, example 코드 보면서 확인했는데, 어떤게 잘못되었을까요?

`async def get_naver_stat(request: Request, response: Response):

# get the target adgroup
uri = '/ncc/adgroups'
method = 'GET'                           
r = requests.get(BASE_URL + uri, headers=get_header(method, uri, API_KEY, SECRET_KEY, CUSTOMER_ID))

target_adgroups = r.json()
target_adgroup = target_adgroups[0]

# get the stat report for the target adgroup
uri = '/stats'
method = 'GET'
stat_ids = [target_adgroup['nccCampaignId'], target_adgroup['nccAdgroupId']]

r = requests.get(BASE_URL + uri, params={'ids': stat_ids, 
                                         'fields': '["clkCnt","impCnt","salesAmt", "ctr", "cpc", "avgRnk", "ccnt"]', 
                                         'timeRange': '{"since":"2024-07-01","until":"2024-07-25"}'}, 
                 headers=get_header(method, uri, API_KEY, SECRET_KEY, CUSTOMER_ID))

print("response status_code = {}".format(r.status_code))
print("response body = {}".format(r.json()))
return r.json()

`

아시는 분 빠르게 답변해주시면 정말 감사하겠습니다! ㅠㅠ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant