Documentation Links
If you use POWER BI you can connect your WhenToWork API (Pro Plan subscribers) to connect.
W2W offers an API that allows developers to access employee and scheduling data. In this tutorial, we will guide you through the process of using W2W’s API. By the end of this tutorial, you will be able to extract scheduling data into Power BI Desktop.
Step 1: Getting Started
The API information can be set up by the main manager using the API Configure link on the Settings section PRO tab.
Clicking the “Enable API Access” button will generate an API Key which will then be shown on the page, along with links to call for JSON data.
Step 2: Understanding the API Documentation
Each endpoint returns JSON data. The current endpoints can give lists of employees, shifts, and positions. They can also return the total number of shifts and hours worked per day, as well as the total number of shifts and hours worked per day listed by position.
Step 3: Making API Calls with Power BI
To get data from W2W into Power BI, select get data with option “Web”
In the new Pop-up select “Advanced” and paste the URL for the desired endpoint into the URL parts box. Make sure to uncheck the “Include key in URL” option when copying your link, as well as changing mm/dd/yyyy into desired start and end dates if applicable. Under the request header parameters option, enter the word “key” into the left box, and paste your API key into the right.
Optionally, you may split the parts so that the start date and end date are in separate parts as the rest of the URL if you wish to turn them into parameters that can be more easily changed.
Continue and select Anonymous access, and apply it to the api level
Upon hitting connect you should see a table with the desired data, which you can use within Power BI once you hit Close & Apply. If necessary you can use this page to remove unnecessary columns, or add new columns to the data. Once the data is in Power BI you can link it with other data such as sales to perform data analysis for staff forecasting or any desired purpose.
Congratulations! You have successfully learned how to use W2W’s API to enter data into Power BI. We hope this tutorial has been helpful in getting you started. If you have any questions or feedback, please do not hesitate to reach out to our support team. Happy coding!