Comments (11)
try with call api from web by copying authorization to the https://api.criteo.com/marketing/swagger/ui/index#!/Statistics/Statistics_GetStats
It is successful.
from criteo-python-marketing-sdk.
Hello @dungthuapps, thanks for reporting your issue.
In fact you got the error because you didn't provide the Configuration object to the ApiClient. These are optional, that's why you didn't have to configure them. Hence, you shouldn't get the error => I'll provide a fix.
Meanwhile, to overcome this problem and get the "automatic token refresh" feature, you can follow the example:
criteo-python-marketing-sdk/examples/authentication.py
Lines 17 to 25 in f28a3e5
from criteo-python-marketing-sdk.
Hi @tpeyrard,
It is good to use configuration. I dont see error.
But when try with get_stats, the result is none. When trying with https://api.criteo.com/marketing/swagger/ui/index#!/Statistics/Statistics_GetStats , result is a link of csv file
from criteo-python-marketing-sdk.
my code:
api_instance = criteo_marketing.StatisticsApi(client)
stats_query_message_ex = criteo_marketing.StatsQueryMessageEx(
report_type="CampaignPerformance"
, dimensions=["CampaignId"]
, metrics=["Clicks"]
, start_date="2019-01-01"
, end_date="2019-01-09"
, format="Csv")
stats_response = api_instance.get_stats(token, stats_query_message_ex)
pprint(stats_response)
result: None
from criteo-python-marketing-sdk.
when using debug, I found the data was returned. but dont know how to get this data
DEBUG:urllib3.connectionpool:https://api.criteo.com:443 "POST /marketing/v1/statistics HTTP/1.1" 200 136
DEBUG:criteo_marketing.rest:response body:
Advertiser Name;Campaign ID;Campaign Name;Currency;Clicks
Adviser_1;222;abc;EUR;111
Adviser_1;222;abc;EUR;111
from criteo-python-marketing-sdk.
Turn out, it sets response_type = None, (even with response_data != None)
(in statistics_api.py, method get_stats_with_http_info(.)
return self.api_client.call_api( '/v1/statistics', 'POST', ... response_type=None, # noqa: E501 ...)
from criteo-python-marketing-sdk.
Hello,
I'll have a look why this endpoints forces OpenAPI generator to set the response_type
to None
.
from criteo-python-marketing-sdk.
Hi @dungthuapps,
patch is on its way. I hope to deploy it today or next Monday.
from criteo-python-marketing-sdk.
@dungthuapps, changes have been rollout.
Please tell me if it works on your side. I added an example to save the content to a file:
criteo-python-marketing-sdk/examples/statistics.py
Lines 25 to 45 in 9bddf47
from criteo-python-marketing-sdk.
hi, updated new version. it works from my side.
both the code above and get_stats(.)
thanks
from criteo-python-marketing-sdk.
Hello
what is the metric name to get the spend of the campaign. I tried cost,spend, campaignCost to no avail. The swagger documentation also doesn't have a place that lists the available metrics to query
Hello @negm could you please ask your question in a new issue, thank you.
from criteo-python-marketing-sdk.
Related Issues (7)
- 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
- ApiException: (400) error HOT 10
- 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.