Comments (10)
Hello @pytmar .
The o_auth2_token_post endpoint expect the grant type as its third parameter.
And for the moment we only support the type "client_credentials".
Could you try again with this call ?
auth_response = auth_api.o_auth2_token_post(client_id=client.configuration.username,
client_secret=client.configuration.password,
grant_type="client_credentials")
from criteo-python-marketing-sdk.
grant_type="client_credentials" : what client_credentials will be here exaclty? as a dict of client_id and client_secret as i wrote above or just one of them if not how and where should i get client_credentials? this is my actual problem i believe because i am not familiar with oauth and i don't understand client_credentials what is i think.
from criteo-python-marketing-sdk.
It is literally the string "client_credentials" :)
The grant type is like an enum of the different types of oauth flows. And the only one acceptable for the moment is "client_credentials".
from criteo-python-marketing-sdk.
I tried as you said, change the grant_type="client_credentials" but i got the same error above again.
from criteo-python-marketing-sdk.
Ok, this line is also problematic: configuration = Configuration(username='mail_address', password='password')
You should put your credentials here.
For example, with this script I'm able to get the token.
import re
import sys
import criteo_marketing as cm
from criteo_marketing import Configuration
configuration = Configuration(username="[email protected]", password="my_super_secret_password")
client = cm.ApiClient(configuration)
auth_api = cm.AuthenticationApi(client)
auth_response = auth_api.o_auth2_token_post(client_id=client.configuration.username,
client_secret=client.configuration.password,
grant_type="client_credentials")
token = auth_response.token_type + " " + auth_response.access_token
print(token)
from criteo-python-marketing-sdk.
I tried this with my authorized account's mail and password but it still gives me the same error
from criteo-python-marketing-sdk.
If the error is still HTTP response body: {'error': 'invalid_grant', 'error_description': 'The client_id or client_secret is incorrect.', 'token_error': "Cannot refresh token by calling 'https://api.criteo.com/marketing/oauth2/token'"}
even with the corrected script it means there is a problem with the actual credentials.
Are you able to connect to https://marketing.criteo.com/ with thoses credentials ?
If your account has been created specifically for API consumption, has it been created with the correct role "Business Manager" ?
cf. https://support.criteo.com/s/article?article=API-Getting-Started&language=en_US
from criteo-python-marketing-sdk.
We have 3 account in criteo marketing: Administrator, Financial Manager and Technical Manager. The credentials are belongs to Administrator. In user section there is no Business Manager role but when i create API Users - REST API i define the role of Administrator as Business Manager, is this could be the problem? should i have a Business Manager role in the user section?
from criteo-python-marketing-sdk.
The account problems are handled by the support.
Could you please contact your account strategist or contact [email protected] ?
from criteo-python-marketing-sdk.
The account problems are handled by the support.
Could you please contact your account strategist or contact [email protected] ?
solved by support team, thank you.
from criteo-python-marketing-sdk.
Related Issues (7)
- Failed to call API with Statistics API HOT 11
- urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.criteo.com', port=443): Max retries exceeded with url: /oauth2/token (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')])")))
- SellersV2StatsApi returns empty HOT 4
- Hour dimension usage in StatisticsApi returns error. HOT 4
- Change Needed HOT 3
- Criteo Python SDK Migration HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from criteo-python-marketing-sdk.