As we begin to improve our support for larger payruns it starts to become impractical to support some synchronous API calls.
For example, reports based on a large dataset can take a long time to generate, potentially timing out an API request. The same applies to importing large files.
With that in mind we've introduced the concept of Jobs. A Contract.JobResponse
is returned instantly which you can then use to check the status of the Job and, where relevant, retrieve the resulting report.
If you request a report from the new AsyncReports version of Gross To Net then
rather than attempting to generate and return the report, it
will instead return immediately with a Contract.JobResponse
.
You can then use the Get Job endpoint to check the status of the Job.
Once the job is complete then the Contract.JobResponse
result
property will contain further information including any errors and,
where appropriate, details of where to retrieve the resultant file (i.e., a CSV or PDF).
The result.file.uri
property will point to the
Get Job File endpoint which returns a filestream.
The result.file.filename
property gives you the suggested filename for the file in the event that you wish to provide it to a user.
These async versions of reports and importing are currently only available to users who have been given access to use beta features.