Expand my Community achievements bar.

Join us January 15th for an AMA with Champion Achaia Walton, who will be talking about her article on Event-Based Reporting and Measuring Content Groups!

Data Warehouse API - reportPeriod

Avatar

Level 1

Hi I'm trying to run a request via the datawarehouse endpoint https://developer.adobe.com/analytics-apis/docs/2.0/guides/endpoints/data-warehouse/#post-scheduled-...

 

However I'm getting an error: It is expected that reportPeriod should be provided with this schedule.

 

There is nothing in the documentation that gives me examples of what the report period should look like. 

 

I have this set in the request 

reportRange: { preset:"Last 7 days" },
 
Can someone provide me documentation around what the reportPeriod needs to be set to?
3 Replies

Avatar

Community Advisor and Adobe Champion

Without seeing everything you have configured...

 

However, based on how other APIs are set up, I would expect something more like 

"dateRange": "2024-10-23T00:00:00.000/2024-10-30T00:00:00.000",
"dateRangeId": "last7Days"

 

dateRange should actually be two specific, well-formed dates.... the dateRangeID is where you get into readable names.... Also, the naming convention of those names is important...

 

I used the Workspace debugger to pull this from another API sample.

 

Also, if you expect the report to run right away, Last 7 Days likely isn't what you want... The Data Warehouse export won't run until all the data is complete... so "Last 7 Days" includes today, so it won't run until after midnight.

 

Last 7 Full Days is likely more what you want:

{
    "type": "dateRange",
    "dateRange": "2024-10-22T00:00:00.000/2024-10-29T00:00:00.000",
    "dateRangeId": "last7FullDays"
}

 

I doubt you need both the dateRange AND the dateRangeId... I assume that because it can, the debugger just provides both... 

 

 

So taking the range syntax from my samples, and merging it to the specifics of the Data Warehouse exports, I would try something like:

"reportRange": {
    "preset": "last7FullDays"
},

 

Avatar

Level 1

Thank you! I tried making a few more updates and finally got the error to return something more useful.

 

reportPeriod was 'lastWeek', but should match one of the following options: 'LAST 30 DAYS', 'LAST 2 WEEKS', 'LAST 3 WEEKS', 'TODAY', 'YESTERDAY', 'LAST 7 DAYS', 'LAST 4 WEEKS', 'THIS WEEK', 'LAST WEEK', 'THIS MONTH', 'LAST MONTH'

 

Avatar

Community Advisor and Adobe Champion

Yay!

 

Also interesting that the preset ranges actually have spaces in them... so much for consistency....

 

I know the APIs can be case sensitive, so try using "LAST 7 DAYS" instead of "Last 7 days"