Forum Discussion
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
- lbendlinSuper User
Use Postman for testing
- AnonymousNot applicable
Hi musicbydannyd ,
This is the related document, you can view this content:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.