Forum Discussion

Pikachu-Power's avatar
Pikachu-Power
Impactful Individual
3 years ago

windsor.ai API / date question

Hello all,

 

i dont know if someone has experience with windsor.ai but I have one date question concerning the windsor.ai API:

 

I use windsor.ai to import Bing Ads data into Power BI via the created weblink like:

 

https://connectors.windsor.ai/bing?api_key=[your API key]&date_preset=last_7d&fields=campaign,clicks,spend,impressions,date,source&_renderer=csv

 

I would like to load all dates from 01.01.2020 until today in a dynamic way. Or last 3 years would be also ok. 

 

date_preset=last_2years is a possible value in the URL but there is no date_preset=last_3years. I could say "&date_from=2020-01-01" but that is not dynamic. After 10 years i would import all dates from 10 years.

 

How could I do that in the URL? Is it maybe possible to say TODAY - last_3years for the date_present field?

 

Many thanks.

 

Best Regards.

6 Replies

    • Pikachu-Power's avatar
      Pikachu-Power
      Impactful Individual

      Hi Artemus,

       

      thanks for your reply. Something with the Format seems to be not ok:

       

      Expected Token: Comma:

       

       

      My whole query looks like:

       

      = Csv.Document(Web.Contents("https://connectors.windsor.ai/all?api_key=[your API key] & DateTimeZone.ToText(DateTimeZone.FixedUtcNow() - #duration(365 * 3, 0, 0, 0), [Format = "yyyy-MM-dd", Culture = ""]) & fields=account_name,campaign,clicks,spend,impressions,date,adnetwork_conversions,&_renderer=csv"),[Delimiter=",", Encoding=65001, QuoteStyle=QuoteStyle.None])

    • Pikachu-Power's avatar
      Pikachu-Power
      Impactful Individual

      Adel but when I say "&date_from=2020-01-01" i get data older than two years. but it is not dynamic. you mean something like TODAY - 3 YEARS is not allowed from the bing ads webside? 

      • Adel's avatar
        Adel
        Helper III

        exactly yes, but i know that with windsor.ai you can pull historical data older than 2 years with almost all marketing platform you would need a data warehouse, and windsor.ai has it's own cloud so maybe that could help.