
{"id":9384,"date":"2023-05-30T18:40:58","date_gmt":"2023-05-30T18:40:58","guid":{"rendered":"https:\/\/when2work.com\/help\/mgr\/?page_id=9384"},"modified":"2023-07-23T23:17:58","modified_gmt":"2023-07-23T23:17:58","slug":"api-power-bi","status":"publish","type":"page","link":"https:\/\/when2work.com\/help\/mgr\/api-power-bi\/","title":{"rendered":"API connect with Power BI &#8211; Pro Plan"},"content":{"rendered":"<div class=\"inforight\">\n<h4 style=\"text-align: center;\"><strong>Documentation Links<\/strong><\/h4>\n<ul>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-access\/\">About W2W API<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-setup\/\">API Setup<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-options-endpoints\/\">Key &amp; Options<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-3rdpartyexports\/\">Preconfigured Third Party Programs<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-general-endpoints-pro-plan\/\">General Endpoints<\/a><\/li>\n<li style=\"text-align: left;\"><a href=\"https:\/\/when2work.com\/help\/mgr\/api-calls\/\">API Calls<\/a><\/li>\n<li style=\"text-align: left;\"><strong><a href=\"https:\/\/when2work.com\/help\/mgr\/api-power-bi\/\">Use with Power BI<\/a><\/strong><\/li>\n<\/ul>\n<\/div>\n<p>If you use POWER BI you can connect your WhenToWork API (<a href=\"https:\/\/when2work.com\/help\/mgr\/w2w-pro-plan\/\">Pro Plan<\/a> subscribers) to connect.<\/p>\n<p>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&#8217;s API. By the end of this tutorial, you will be able to extract scheduling data into Power BI Desktop.<\/p>\n<h3>Step 1: Getting Started<\/h3>\n<p>The API information can be set up by the main manager using the API <strong>Configure<\/strong> link on the <strong>Settings <\/strong>section<strong> PRO<\/strong> tab.<\/p>\n<p>Clicking the &#8220;<strong>Enable API Access<\/strong>&#8221; button will generate an API Key which will then be shown on the page, along with links to call for JSON data.\u00a0<\/p>\n<p><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-api-enable.png\"><img class=\"aligncenter size-full wp-image-9394\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-api-enable.png\" alt=\"\" width=\"700\" height=\"609\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-api-enable.png 700w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-api-enable-300x261.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-enpoints.png\"><img class=\"aligncenter  wp-image-9396\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-enpoints.png\" alt=\"\" width=\"487\" height=\"449\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-enpoints.png 700w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/ss-enpoints-300x277.png 300w\" sizes=\"(max-width: 487px) 100vw, 487px\" \/><\/a><\/p>\n<h3 data-renderer-start-pos=\"599\">Step 2: Understanding the API Documentation\u00a0<\/h3>\n<p data-renderer-start-pos=\"645\">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.\u00a0<\/p>\n<h3 data-renderer-start-pos=\"911\">Step 3: Making API Calls with Power BI\u00a0<\/h3>\n<p data-renderer-start-pos=\"952\">To get data from W2W into Power BI, select get data with option &#8220;Web&#8221;\u00a0<\/p>\n<p data-renderer-start-pos=\"952\"><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi1.png\"><img class=\"aligncenter  wp-image-9388\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi1.png\" alt=\"\" width=\"340\" height=\"456\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi1.png 551w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi1-224x300.png 224w\" sizes=\"(max-width: 340px) 100vw, 340px\" \/><\/a><\/p>\n<p data-renderer-start-pos=\"952\">In the new Pop-up select &#8220;Advanced&#8221; and paste the URL for the desired endpoint into the URL parts box. Make sure to uncheck the &#8220;Include key in URL&#8221; 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 &#8220;key&#8221; into the left box, and paste your API key into the right.\u00a0<\/p>\n<p data-renderer-start-pos=\"952\"><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi2.png\"><img class=\"aligncenter size-full wp-image-9389\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi2.png\" alt=\"\" width=\"668\" height=\"417\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi2.png 668w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi2-300x187.png 300w\" sizes=\"(max-width: 668px) 100vw, 668px\" \/><\/a><\/p>\n<p data-renderer-start-pos=\"952\">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.<\/p>\n<p data-renderer-start-pos=\"952\"><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi3.png\"><img class=\"aligncenter size-full wp-image-9390\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi3.png\" alt=\"\" width=\"675\" height=\"439\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi3.png 675w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi3-300x195.png 300w\" sizes=\"(max-width: 675px) 100vw, 675px\" \/><\/a><\/p>\n<p data-renderer-start-pos=\"952\">Continue and select Anonymous access, and apply it to the api level\u00a0<\/p>\n<p data-renderer-start-pos=\"952\"><a href=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi4.png\"><img class=\"aligncenter size-full wp-image-9391\" src=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi4.png\" alt=\"\" width=\"672\" height=\"259\" srcset=\"https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi4.png 672w, https:\/\/when2work.com\/help\/mgr\/wp-content\/uploads\/sites\/2\/2023\/05\/powerbi4-300x116.png 300w\" sizes=\"(max-width: 672px) 100vw, 672px\" \/><\/a><\/p>\n<p data-renderer-start-pos=\"1700\">Upon hitting connect you should see a table with the desired data, which you can use within Power BI once you hit Close &amp; Apply. If necessary you can use this page to remove unnecessary columns, or add new columns to the data.\u00a0Once 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.<\/p>\n<p data-renderer-start-pos=\"2077\">Congratulations! You have successfully learned how to use W2W&#8217;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!\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Documentation Links About W2W API API Setup Key &amp; Options Preconfigured Third Party Programs General Endpoints API Calls Use with Power BI If you use&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"https:\/\/when2work.com\/help\/mgr\/api-power-bi\/\">More<span class=\"screen-reader-text\">API connect with Power BI &#8211; Pro Plan<\/span><\/a><\/div>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/pages\/9384"}],"collection":[{"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/comments?post=9384"}],"version-history":[{"count":21,"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/pages\/9384\/revisions"}],"predecessor-version":[{"id":9879,"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/pages\/9384\/revisions\/9879"}],"wp:attachment":[{"href":"https:\/\/when2work.com\/help\/mgr\/wp-json\/wp\/v2\/media?parent=9384"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}