srinath

srinath

  • NA
  • 144
  • 0

Custom Date Range in Double Click Bid Manager

Jul 15 2019 2:13 PM

I am creating a new report using CreateQuery() in Double Click Bid Manager with Date Range as "Custom_Dates" but running out of exception as below -

**Google.Apis.Requests.RequestError

The request you submitted is invalid. [400]

Errors [

Message[The request you submitted is invalid.] Location[ - ] Reason[validationError] Domain[global]

]**

Below is the code which I was trying for Custom Date. I am having issue with

ReportDataStartTimeMs, ReportDataEndTimeMs values as they are expecting long datatype values, I have tried with .ticks for the date as well and in google search I could see .ticks will take as nanoseconds. tried with different datetime values.

DateTime dtStart = new DateTime(2019, 07, 11, 0, 0, 1, 1);

DateTime dtEnd = new DateTime(2019, 07, 12, 0, 0, 1, 1);
 
                           or 

DateTime dtStart = Convert.ToDateTime("2019/07/11",

CultureInfo.InvariantCulture);

DateTime dtEnd = Convert.ToDateTime("2019/07/12",

CultureInfo.InvariantCulture);

                             or 

DateTime dtStart = Convert.ToDateTime("2019/07/11"); 

DateTime dtEnd = Convert.ToDateTime("2019/07/12");

1) query.ReportDataStartTimeMs =

Convert.ToInt64((DateTime.Now.ToUniversalTime() -

dtStart).TotalMilliseconds + 0.5);

query.ReportDataEndTimeMs =

Convert.ToInt64((DateTime.Now.ToUniversalTime() -

dtEnd).TotalMilliseconds + 0.5); 

2) query.ReportDataStartTimeMs =

Convert.ToInt64(DateTime.UtcNow.Date.Subtract(new DateTime(2019,

07, 11)).TotalMilliseconds);

query.ReportDataEndTimeMs =

Convert.ToInt64(DateTime.UtcNow.Date.Subtract(new DateTime(2019,

07, 12)).TotalMilliseconds); 

3) query.ReportDataStartTimeMs = dtStart.Ticks / 1000000;

query.ReportDataEndTimeMs = dtEnd.Ticks / 1000000;

I am expecting to create a new report on executing - Createquery(query).Execute(); method. Please help me on this issue