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
mahonni
Frequent Visitor

Pull data from a REST API Authentication with a nonce field

Hi, I'm trying to use this API, following posts like this one but I keep getting "invalid arguments" error. The idea is to get info like the "balance", so I need to use POST instead of GET.

 

I barely understand how APIs work, but looking at the documentation, it looks like I need to send a nonce which I understand it has to be an increasing number every time and that I can't repeat it. The problem is that this nonce field has to be send in the POST data, but I only know how to send data as a header.

 

How should I do that?

 

Thanks!!

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

@mahonni,

Based on my research, the above error could occur when you enter wrong API-Key or API-Sign, please find correct API-Key and API-Sign following the guide in the similar threads below, then enter them in Power BI Desktop.
1.JPG

https://superuser.com/questions/1123526/curl-example-for-accessing-authenticated-kraken-api
https://stackoverflow.com/questions/43722037/kraken-eapi-invalid-key

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your answer, @v-yuezhe-msft.

 

I was doing it in the same was as you put it, but without the "Accept" part in the header. However, it still didn't work.

 

The API-Key and API-Sign are correct, but here's my doubt: is PowerBI doing the rest of the process (using a nonce, doing hmac signature...), or do I have to manually create that? And, in case I have to do it myself, is it possible to HMAC-SHA512?

 

Thanks in advance,

 

Marc

@mahonni,

You would need  to manually create the rest of the process.  Power BI doesn’t offer a function to calculate a HMAC-SHA512 hash, the entire HMAC-SHA512 algorithm has to be reproduced from scratch using M code. There is a similar blog about reproduce HMAC-SHA1 algorithm in M code for your reference.

https://chris.koester.io/index.php/2016/07/15/post-twitter-using-power-query/

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sounds like it'll take too much effort to get that. PowerBI is quite behind when it comes to APIs, most of them are using this kind of algotyhms, so the implementation is almost impossible. I'll see if I can solve it with some Python + SQL and then get the source from this database.

 

Anyway, thanks @v-yuezhe-msft for the help!

Hi, did you manage to do this in the end?

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.