Skip to main content
Skip table of contents

Raw reports example with Postman

Other API platforms are available. This example uses Postman.

You’re going to be following links in responses using the same headers, so check that this is enabled in settings:

Pop-up window showing general settings for Postman. One option, highlighted, is 'Retain headers when clicking on links'. This setting can be toggled on or off.

Initial request:

CODE
GET https://reports.openathens.net/api/v1/example.org/rawreport?date=2023-05-22 
Authorization: OAApiKey <api-key>

Replace example.org with your domain name - e.g. wessex.ac.uk or holby.edu.

The API key goes in the headers section.

Postman workspace, open at the Headers tab. A table shows specified keys and their values. A key named 'Authorization' is set to a value that has the prefix 'OA' (most of the rest is blacked out).

Check status:

Click on the href in the response to the initial request. This will open a new tab where you can click on send. The response to that will have a status of RUNNING or FINISHED:

Postman workspace. In the Body area is a script with the status 'FINISHED'.

If the status was RUNNING, then the report hasn't been completely built yet and the href will be to itself - click the href to open a new tab but wait a bit before hitting send. If you were coding this you'd set a wait of about 20s per cycle, and that's about right here too.

If as above the status says FINISHED, then the href will open a tab where you can download the results.

Download:

The download is a zipped CSV file so you will want to use the arrow next to send to let you download the response instead of displaying it.

You can also add a filename parameter to the URL if you like. If you don’t the job ID is used as the filename.

Postman workspace. Following the GET field, which contains the target URL, is a button marked 'Send' that includes a drop-down arrow. The arrow has been clicked, showing the additional option 'Send and Download'.

Unzip the file and open the CSV in your spreadsheet or BI program of choice.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.