FAQ content

API: Overview of the LibStaffer API

In this article

To access the API, go to Admin > Widgets & API. All endpoints are listed under the Endpoints 1.0 tab of the Widgets & API page.

the Endpoints 1.0 tab
Admin users can access the API documentation under the Admin > Widgets & API tab.

What is an API?

API stands for Application Programming Interface and it allows you to display and process your LibStaffer content outside of your system. The LibStaffer API offers more flexibility than widgets, but it also requires more extensive coding knowledge and is more complicated than just copying and pasting some embed code.

To think of this in another way, widgets are kind of like a frozen dinner - what you see is what you get. APIs are like individual ingredients. Think of all the different meals a cook can create from the same set of ingredients! APIs offer you the same opportunity to mix & match. The possibilities are almost endless!

API v1.0 endpoints

The v1.0 endpoints include requests that allow you to get data from your system. In order to request data from the API, you must first set up an application in LibStaffer. This will provide you with a unique Client ID and Client Secret, which you will need in order to obtain an access token. A valid token is required for LibStaffer to return data to your app. If you do not include an access token, or the token is expired, an error message will be returned.

Your existing applications will be displayed under the API Authorization tab. If you need to create a new one:

  1. Under the API Authorization tab, click on the Create New Application button. 
the Create New Application button
Click the Create New Application to generate a new key/secret pair to use in your app.
  1. In the Create Application modal window, give your application a name. This is only used to help you organize your applications, so you know which ID/Secret pairs you're using with your different apps.
  2. Optionally, you can add a Description to provide more info about how you're using this application.
  3. For the Scope, select the checkbox for each module you want this application to have access to.
    • Available Hours - Read: this will give the application read-only access to each user's available working hours.
    • Users - Read: this will give the application read-only access to user-specific information, including their name, email address, assigned shifts, and time off.
    • Schedules - Read: this will give the application read-only access to schedule information, including schedule names, account IDs for assigned staff, friendly URLs, and shifts.
  4. Click the Create button to save your changes.
The Create Application modal window
In the Create Application modal window, you are defining the name, description, and scope of your app. The scope specifically restricts which endpoints the app can access.
  1. Your Client ID and Client Secret will appear in the Applications table.
  2. To obtain an access token, use the /api/1.0/oauth/token endpoint for your site's API. You'll find this information in the Obtaining an Access Token box on the API Authorization page.
    • The LibStaffer v1.0 API uses oAuth 2.0 for authentication and supports the Client Credentials grant type.
  3. When submitting your API request, you'll need to provide that token in the Authorization header. You can find an example for your site in the Authorizing your API Requests box on the API Authorization page.
The Obtaining an Access Token and Authorizing your API Requests boxes
You can find the information you need to obtain an access token in the Obtaining an Access TokenAuthorizing your API Requests, and Applications section. Note that all requests must have a valid bearer token or they will fail.

Available endpoints

Full details for using each endpoint are available in LibStaffer under the Endpoints 1.0 tab -- just click on the endpoint's URL on that page to view its specific documentation and example requests.

links under the Endpoints 1.0 tab
To view the full documentation for an endpoint, click on its link in the URL column.

Below is a summary of what you can do with the available endpoints.

  • Available Hours: the /available_hours endpoint allows you to get the available working hours for all users in your system but can be used to retrieve hours for a single user ID, as well.
  • Schedules: the /schedules endpoint allows you to get information about your schedules, such as schedule names and assigned user IDs. The /schedules/shifts endpoint allows you to get a schedule's shifts up to 90 days in the future.
  • Users: the /users endpoint allows you to get information about your users, including their names and email addresses. The /users/shifts endpoint allows you to get an individual user's assigned shifts, while /users/timeoff endpoint does the same for time off requests.