Feeds and Reports
Generating a report
Reports are created by submitting a request to the SP API, and then polling for the report's status until it is complete. Once the report is complete, it can be downloaded. The ReportService
class provides a wrapper around this process, along with the CreateReportJob
, GetReportJob
, and DownloadReportJob
queueable jobs. The simplest way to generate a report is to call the Report::generate()
method:
This will dispatch a chain of queued jobs that create the report, poll for the report's status, and download the report. The report's results will be passed to the callback function passed to Report::generate()
, which should take two parameters: the Report
model, and the contents of the report as an array, SimpleXMLElement
object, or string depending on the report type.
Uploading a feed
Feeds are created by submitting a request to the SP API, and then polling for the feed's status until it is complete. Once the feed is complete, it can be downloaded. The FeedService
class provides a wrapper around this process, along with the CreateFeedJob
and GetFeedResultJob
queueable jobs. Similarly to reports, the Feed::submit()
method can be used to create and process a feed:
Once the feed has finished processing, the raw feed result document is saved to $feed->results
.
Last updated