Data Warehouse API - reportPeriod | Community
Skip to main content
October 29, 2024
Question

Data Warehouse API - reportPeriod

  • October 29, 2024
  • 1 reply
  • 809 views

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-request

 

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?
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 29, 2024

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" },

 

user82970Author
October 29, 2024

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'

 

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
October 29, 2024

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"