Blue Prism API example usage

This page contains detail on how you can use a series of requests to achieve certain tasks programmatically via the Blue Prism API. Full details of the requests can be found in the Blue Prism API reference. To access the API reference, see Blue Prism API.

API base URL

The API Reference provides the API endpoints that enable you to interact with Blue Prism programmatically, for example, /api/v7/sessions. To successfully call the API, you also need to include the base URL in the request.

The format of the base URL for the Blue Prism API is:

http(s)://<address>/api/v7

The value of <address> is dependent on how your environment is configured. Typically, it will be the host name of the web server where the API is installed. For example:

https://bpapi.mydomain.com/api/v7

So, to call the sessions API endpoint, you would use the following URL:

https://bpapi.mydomain.com/api/v7/sessions

Calendar management

You can use requests to the calendar endpoint to create, update, and manage your Blue Prism calendars. For example, to create and then update a calendar:

Step

Request

Description

1

GET /api/v7/holidayRegions

Send a GET request to retrieve the regionId. Make a note of the ID for the relevant region as you will need this for future requests.

2

GET /api/v7/holidayRegions/{holidayRegionId}/publicHolidays

Example URL: GET /api/v7/holidayRegions/1/publicHolidays

Send a GET request populated with the regionId retrieved in step 1. This will return the calendar's public holidays with their respective IDs. Make a note of the IDs for any public holidays you want to disable for the calendar as you will need these for future requests.

3

POST /api/v7/calendars

Example body request:

Copy
{
  "name": "new calendar",
  "workingWeek": [
    "Monday" 
  ],
  "region": {
    "regionId": "1",
    "disabledPublicHolidaysIds": [
      2
    ]
  }
}

Send a POST request to create a new calendar. In the body request you can configure the name, workingWeek, the regionId (from step 1), and any disabledPublicHolidaysIds (from step 2). If there are multiple holidays you want to disable for the calendar, you can provide these in an array.

If successfully created, the request will return a calendarId for the new calendar.

4

POST /api/v7/calendars/{calendarId}/otherHolidays/batch

Example URL: POST /api/v7/calendars/4/otherHolidays/batch

Example body request:

Copy
{
  "holidays": [
    "2022-08-23", "2022-11-28"
  ]
}

Send a POST request populated with the calendarId retrieved in step 3. In the body request you can configure other holidays to be added to the calendar.