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
Anonymous
Not applicable

Problems with JSON API Connection

So I have a service that has API functionality but the authentication requires more than my basic knowledge of this. The API support is no help so I am stuck figuring this out myself.

 

Auth Request URL:

https://{API Key}:{Password}@api.xxxx.com/{API Endpoint}

Some details:

APIKey = "1234567" Password = "abcdefghijklmon"

Should be specified: 

Content-Typeheaderapplication/json; charset=utf-8 and an

Acceptheaderapplication/json.

 

I have tried 

 

= Web.Contents("https://api.xxxx.com/api/" & "{API Endpoint}", [Headers=[ContentType="application/json; charset=utf-8", Accept="application/json", #"API Key"="1234567", #"Password"="abcdefghijklmon"]])

 

and 

 

= Web.Contents("https://1234567:abcdefghijklmon@api.xxxx.com/api/" & "{API Endpoint}", [Headers=[ContentType="application/json; charset=utf-8", Accept="application/json"]])

 

But they both did not work. 

 

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

If you are not familiar with the code, you could use UI to connect to.

There are some references.

Calling REST APIs and Parsing JSON made simple with Power BI

Power BI – Connect to your secure API

If you have any problem, please let me know.

 

Best Regards
Maggie

 

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

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.

Top Solution Authors
Top Kudoed Authors