Get booking reports for a given venueId
Name | Type | Required | Description |
---|---|---|---|
venueId | int | Yes | Venue Id |
type | string | Yes | Report type |
start | string | Yes | Date 'YYYY-MM-DD' |
end | string | Yes | Date 'YYYY-MM-DD' |
task | bool | No | Req. async process |
const data = await deskbookers.reports.bookings.enquire({
venueId: 39418,
type: 'month_overview',
start: '2017-09-01',
end: '2017-11-01',
task: true
})
Get async booking reports for a given venueId
and jobId
,
if task
was sent as true
on booking.enquire
, an jobId
is returned and when passed to retrieve
it will get the actual
processing state and return the percentage, status and the actual
data if available.
Name | Type | Required | Description |
---|---|---|---|
venueId | int | Yes | Venue Id |
type | string | Yes | Report type |
jobId | int | Yes | Async job id |
const data = await deskbookers.reports.bookings.retrieve({
venueId: 39418,
type: 'month_overview',
jobId: 13
})
Get booking referrers report for a given date range.
Name | Type | Required | Description |
---|---|---|---|
start | string | No | Only consider data after this start date |
end | string | No | Only consider data untul this end date |
onProgress | callback | No | Get updates about latest state of the report job |
autoRetrieve | bool | No | Auto retrieve the result of the report and return everything as a promise (enabled by default) |
const data = await deskbookers.reports.bookingReferrers.enquire({
start: '2017-09-01',
onProgress: ({ jobInfo, logs }) => {
console.log(jobInfo.progress)
}
})
console.log(data.url) // URL to download the report
Get async booking referrers reports for a given jobId
.
Name | Type | Required | Description |
---|---|---|---|
jobId | int | Yes | Async job id |
const { jobInfo } = await deskbookers.reports.bookingReferrers.enquire({
start: '2017-09-01',
autoRetrieve: false
})
let data
do {
data = await deskbookers.reports.bookingReferrers.retrieve({
jobId: jobInfo.id
})
} while (data.jobInfo.state !== 'complete' && data.jobInfo.state !== 'failed');
console.log(data.url)