Dear Adobe documenters,
during consuming your API I came across a conflict between your API specification and the accompanying documentation.
I am trying to consume Report.Queue endpoint.
The API is documented in r_Queue.md.
My payload is (replace True
with true
, False
with false
and None
with null
if you can't read Python):
report_suite_id = "my_report_suite_id"
payload = {
"reportDescription": {
"reportSuiteID": report_suite_id,
"date": "2018-01-01",
"dateFrom": "2018-01-01",
"dateTo": "2018-01-01",
"dateGranularity": "",
"metrics": [
{
"id": "visits"
}
],
"sortBy": "string",
"elements": [
{
"id": "prop1",
"classification": "",
"top": 2,
"startingWith": 0,
"search": {
"type": "and",
"keywords": [
"string"
],
"searches": [
None
]
},
"selected": [
"string"
],
"checkpoints": [
],
"parentID": "string",
"pattern": [
[
"string"
]
],
"everythingElse": True
}
],
"segments": [],
"locale": "en_US",
"currentData": False,
"anomalyDetection": False,
"expedite": False,
"elementDataEncoding": "base64",
"sortMethod": "string",
"source": "standard",
"ftp": {
"host": "string",
"port": 0,
"directory": "string",
"username": "string",
"password": "string",
"filename": "string"
}
}
}
Calling the API with these payload yields:
{'error_uri': 'https://marketing.adobe.com/developer/en_US/documentation/analytics-reporting-1-4/r-reportdescription-1', 'error_description': 'both date and dateFrom or dateTo cannot be specified', 'error': 'period_invalid'}
However, if I leave away either date
or dateFrom
and dateTo
I receive a ModelValidationError.
Looking closer at the OpenAPI specification by loading it into Swagger's online editor (using the File nav item) leads me to look at line 7453:
reportDescription:
type: object
properties:
reportSuiteID:
type: string
date:
type: string
dateFrom:
type: string
dateTo:
type: string
dateGranularity:
type: string
metrics:
$ref: '#/definitions/reportDescriptionMetricList'
sortBy:
type: string
elements:
$ref: '#/definitions/reportDescriptionElementList'
segments:
$ref: '#/definitions/reportDescriptionSegmentList'
locale:
$ref: '#/definitions/reportDescriptionLocale'
currentData:
type: boolean
anomalyDetection:
type: boolean
expedite:
type: boolean
elementDataEncoding:
$ref: '#/definitions/reportDescriptionElementDataEncoding'
sortMethod:
type: string
source:
$ref: '#/definitions/reportDescriptionSource'
ftp:
$ref: '#/definitions/reportDescriptionFtp'
required:
- reportSuiteID
- date
- dateFrom
- dateTo
- dateGranularity
- metrics
- sortBy
- elements
- segments
- locale
- currentData
- anomalyDetection
- expedite
- elementDataEncoding
- sortMethod
- source
- ftp
That is, date
, dateFrom
and dateTo
are all required parts of the payload.
This conflicts with the documentation in r_Queue.md (linked above)
date/dateFrom/dateTo
If the date parameter(s) are omitted, the current day is used.
I would have expected these parameters to be optional.