Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
musicbydannyd
Advocate IV
Advocate IV

REST API-UKG (saashr.com)

Hi all... I have a question posted on Stack Overflow (https://stackoverflow.com/questions/72305239/rest-api-ukg-saashr-com-using-power-query), which goes like this:

 

Newbie to REST API here and struggling with authentication using Power Query (M). Trying to get UKG (saashr.com) payroll data token... their REST API guide is here: https://secure.saashr.com/ta/docs/rest/public/

I've tried hard coding credentials (with "anonymous" data source permissions) using the following code:

 

let UKGToken = Json.Document(Web.Contents("https://secure.saashr.com/ta/rest/v1/login", [Headers=[#"Accept"="application/json", #"Content-Type"="application/json", #"Api-Key"="987654321abcdefg"], Content=Text.ToBinary("{""credentials"": {""username"": ""Username1"",""password"": ""Password1"",""company"": ""123456""}}")]))[token] in UKGToken

 

But, I am getting "Expression.Error: Access to the resource is forbidden."

Also tried removing username/password from headers and entering credentials in data source settings with no luck.

TIA, Danny

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

lbendlin
Super User
Super User

Use Postman for testing

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.