user:
userid:
representing:

Important: This will require you to create a profile in Postman. If you do not already have a Postman profile you can create a free one by selecting 'Sign Up for Free' within Postman and following the prompts. 

 

Locate the API in Postman

Navigate to https://www.postman.com/hpps/workspace/pbs-public-data-api/collection/33098837-829fc4a1-741d-4807-b524-a492afe522bb?action=share&creator=33098837. This will direct you to the PBS Public data API collection (shown in Figure 1). The left hand side displays the 26 endpoints available in the API. A description of each table and their data can be found in the data dictionary available in our article on Accessing PBS embargo data via the API.

Figure 1: Screenshot of the PBS Public Data API collection in postman

Loading the collection into your own workspace  

In order to download the data from the API, you will need to 'fork' the collection which will create a duplicate of the collection within your own workspace in Postman. General information on forks in Postman can be found in the Postman user guidance here.

To fork the collection, follow the steps below:

  1. Select the three dots next to PBS Public Data API (shown in Figure 2). Select 'Create a fork' from the drop-down that appears (shown in Figure 2).

    Figure 2: Collection drop-down menu with three dots and 'Create a fork' options highlighted
     
  2. Selecting 'Create a fork' will open a new 'Create Fork' tab in Postman . Here you will need to name your fork and select which workspace you want to add the fork to (shown in Figure 3). Postman will set the fork label to your user name and the workspace to 'My Workspace' by default. Here you will also have the option to select 'Watch original collection'. Ticking this box will notify you when updates are made to the API or endpoints.

    Figure 3: Create Fork tab in Postman with Fork Label, Workspace and Notifications fields highlighted.
     
  3. Select 'Fork Collection'. This will open a duplicate of the collection in your own space with the label you gave your fork (shown in Figure 4). Changes made in your workspace will not flow through to the original collection from which you made your fork. 

    Figure 4: Fork of PBS Public Data API with fork label highlighted

Downloading data from the API

  1. Navigate to the schedules endpoint and select 'Send' (shown in  Figure 5). This will make sure that you are capturing data from the latest schedule. This step will only need to be conducted at the start of the month when the latest schedule is made available.

    Figure 5: Schedules endpoint with 'Send' highlighted 
     
  2. Navigate to the endpoint you wish to download (e.g. items, fees, etc,.) and select 'Send' as you did for Step 1. This will pull the data from the selected endpoint into the Response field at the bottom of Postman (shown in Figure 6).
  3. To save this as a CSV, select the three dots in the upper right corner of the response section and select 'Save response to file' (shown in figure 6). The file name will save as 'response.csv' by default.

    Figure 6: Response section in Postman with 'Save response to file' highlighted

Keywords: User Support, API, public, PBS

Topic:

Last Updated: 01 March, 2024