GuidesAPI ReferenceChangelogDiscussions
GuidesAPI ReferenceChangelogLog In

Discussions

Ask a Question
Back to All

403 error, access-control, when searching campaigns

When running this:

-- start code --

get all advertisers

url = 'https://api.criteo.com/2022-10/advertisers/me'

headers = {
'Authorization': 'Bearer ' + access_token,
'Accept': 'text/plain',
'Content-Type': 'application/*+json'
}

response = requests.get(url, headers=headers, data=payload)

print(response)
response.json()

-- end code --

I get the following output:
<Response [200]>
{'data': [], 'errors': [], 'warnings': []}

OK, so we have the correct access. When running this code to get campaigns:

-- start code --

get all campaigns

url = 'https://api.criteo.com/2022-10/marketing-solutions/campaigns/search'

payload={
"filters": {}
}
headers = {
'Authorization': 'Bearer ' + access_token,
'Accept': 'text/plain',
'Content-Type': 'application/*+json'
}

response = requests.get(url, headers=headers, data=payload)

print(response)
response.json()

-- end code--

I get this out put:
<Response [403]>
{'data': None,
'warnings': [],
'errors': [{'traceIdentifier': '0HMM3BKOTTRGJ:00000001',
'type': 'access-control',
'code': 'insufficient-permissions',
'instance': '/v21q2/campaigns/search',
'title': 'Access control error',
'detail': None,
'source': None}]}

We verified we have all read rights on Audiences, Analytics, Campaigns, Catalogs, and Creatives on the app we created.

How can get the correct permissions? Or is there something else we are doing wrong?

Our goal is to get campaign statistics per day (costs, clicks, impressions for example)

Thanks in advance,
Michael