Forum Discussion
Pull data from a REST API Authentication
- 8 years ago
Hi surfersamu,
I have tested in Power BI desktop using the connection information you provided, there is no error throws out. After you fill the connection information like the image you provided and click OK button, please use Anonymous authentication, as you already provide the authorization key.
You can download the attached pbix file to have a look. By the way, here are some samples of calling API to get data in Power BI:
Calling REST APIs and Parsing JSON made simple with Power BI
Get Data from Twitter API with Power Query
Best Regards,
Qiuyun Yu
Hi surfersamu,
I have tested in Power BI desktop using the connection information you provided, there is no error throws out. After you fill the connection information like the image you provided and click OK button, please use Anonymous authentication, as you already provide the authorization key.
You can download the attached pbix file to have a look. By the way, here are some samples of calling API to get data in Power BI:
Calling REST APIs and Parsing JSON made simple with Power BI
Get Data from Twitter API with Power Query
Best Regards,
Qiuyun Yu
UltiPro support takes a very long time to reply.
Ok I found the reason why is not working. Because UltiPro requires you to get a token to make a SOAP request. I have a token now.
Using advanced editor how can I fix this code:
I keep getting:
DataSource.Error: Web.Contents failed to get contents from 'https://service4.ultipro.com/services/EmployeePerson' (415): Unsupported Media Type
let
Source = Xml.Tables(Web.Contents("https://service4.ultipro.com/services/EmployeePerson"
,[Content=Text.ToBinary("<s:Envelope xmlns:a="&Character.FromNumber(34)&"http://www.w3.org/2005/08/addressing"&Character.FromNumber(34)&" xmlns:s="&Character.FromNumber(34)&"http://www.w3.org/2003/05/soap-envelope"&Character.FromNumber(34)&">
<s:Header>
<a:Action s:mustUnderstand="&Character.FromNumber(34)&"1"&Character.FromNumber(34)&">http://www.ultipro.com/services/employeeperson/IEmployeePerson/FindPeople</a:Action>
<UltiProToken xmlns="&Character.FromNumber(34)&"http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken"&Character.FromNumber(34)&">6ddeadsfdsfdsfsdfdsfdsfds6</UltiProToken>
<ClientAccessKey xmlns="&Character.FromNumber(34)&"http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey"&Character.FromNumber(34)&">ABCD</ClientAccessKey>
</s:Header>
<s:Body>
<FindPeople xmlns="&Character.FromNumber(34)&"http://www.ultipro.com/services/employeeperson"&Character.FromNumber(34)&">
<query xmlns:b="&Character.FromNumber(34)&"http://www.ultipro.com/contracts"&Character.FromNumber(34)&" xmlns:i="&Character.FromNumber(34)&"http://www.w3.org/2001/XMLSchema-instance"&Character.FromNumber(34)&">
<b:CompanyCode />
<b:CompanyName />
<b:Country />
<b:EmployeeNumber />
<b:FirstName>like (a%)</b:FirstName>
<b:FormerName />
<b:FullOrPartTime />
<b:Job />
<b:LastHire />
<b:LastName />
<b:Location />
<b:OrganizationLevel1 />
<b:OrganizationLevel2 />
<b:OrganizationLevel3 />
<b:OrganizationLevel4 />
<b:OriginalHire />
<b:PageNumber />
<b:PageSize />
<b:PayGroup />
<b:Status />
<b:SupervisorLastName />
<b:TerminationDate />
<b:TimeClockId />
</query>
</FindPeople>
</s:Body>
</s:Envelope>"),Headers=[#"Accept-Encoding"="gzip,deflate", #"Accept"="Basic U0VfdasdasfdasMjAxNyE=", #"Content-Type"="text/xml;charset=UTF-8"]]
))
in
Source
- v-qiuyu-msft8 years agoCommunity Support
Hi surfersamu,
It seems your original issue is solved, right?
Regarding the second issue, if you are not familiar with the Power Query, please use features available in Query Editor UI to transform data. As this is another issue, please post in a new thread and share the pbix file if possible.
Best Regards,
Qiuyun Yu