abujehad139 / google-api-go-client

Automatically exported from code.google.com/p/google-api-go-client
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

setting a report's startDate and endDate in the dfareporting api to json null #46

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. In the Report Builder UI create a report with a startDate and endDate
2. Attempt to patch the report to a relativeDateRange
3. Try to set the startDate and endDate to ""
3. An Error 400 is produced

What is the expected output? What do you see instead?
There needs to be a method of setting the startDate and endDate to the JSON 
null (which is null and not "null" in the current JSON output, see below)

What version of the product are you using? On what operating system?
dfareporting v1.3

Please provide any additional information below.
Hey Frank,

Ah, very interesting. In order for that to work, the expected JSON value is 
null - not the string "null". Consider the following request:

PATCH 
https://www.googleapis.com/dfareporting/v1.3/userprofiles/857012/reports/1680785

Content-Type: application/json

{
  "criteria": {
    "dateRange": {
      "kind": "dfareporting#dateRange",
      "startDate": null,
      "endDate": null,
      "relativeDateRange": "LAST_7_DAYS"
    }
  }
}

This will do what you want to do. I'm not sure if this is possible using the Go 
library; if its not, I'd recommend filing it as a bug on their issue tracker.

Regards,
- Joseph DiLallo, the DFA API Team

Original issue reported on code.google.com by ffdavid...@gmail.com on 16 Oct 2013 at 8:58