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

Problem to connect with private BMC Rest API

Hello,

 

I am trying  to access and connect BMC remedy API but no luck.

Steps I followed : Common data Source (Web)-> provided the URL and hit connect but it says 

 

porwalhimanshu_0-1606811869615.png

I know this API should be authorize but I do have the authorization header 

porwalhimanshu_1-1606812029404.png

 

I tried th work around as I have seen in one of the post here.

https://community.powerbi.com/t5/Desktop/REST-API-web-data-source-Authentication-Header-is-gone/td-p...

let
Source = Json.Document(Web.Contents("insert the URL here you used to in the regular way, and add ", [Headers=[Authorization="Basic insert your token here="]])),
issues = Source[issues],
       in
       Source 

 

but this one also giving an error : 

Expression.Error: The 'Authorization' header is only supported when connecting anonymously. These headers can be used with all authentication types: Accept, Accept-Charset, Accept-Encoding, Accept-Language, Cache-Control, Content-Type, If-Modified-Since, Prefer, Range, Referer

 

I have no idea how to fix it, anyone can assit me here.

 

Power BI Version : Version: 2.87.923.0 64-bit (november 2020)

 

Thanks

H.

 

 

4 REPLIES 4
PhilipTreacy
Super User
Super User

Hi @Anonymous 

A 500 error indicates an internal server problem with the API /web server.  Perhaps something in the request you sent crashed it or maybe it's misconfigured - hard to say.

Can you please share the actual query you are using, you can replace any sensitive info like password/username.

How does the API specify that you should connect to it?  What documentation do you have that describes this?

You say that it requires authentication - do you know what type?  Does it require an access token to be created before trying to retrieve data?

Phil


If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

Hi @PhilipTreacy 

I just tried once again and follow the below and now I am able to connect with private API. yes It is authorized by token.

let
Source = Json.Document(Web.Contents("insert the URL here you used to in the regular way, and add ", [Headers=[Authorization="Basic insert your token here="]])),
issues = Source[issues],
       in
       Source 

 

 

My follow up question here.

This token is expire in some interval, how I can refersh the token in Power BI itself

 

Thanks

H.

Hi @Anonymous 

I am also trying to connect BMC ready private API but getting below error . Please suggest if you can what's going wrong here . 

Screenshot_2022-05-23-19-08-40-02_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

 

There'@porwalhimanshu,

I would like to suggest that you add the 'relativepath' parameter to the web connector and its request URL.
AFAIK, sometimes these anonymous requests with header or other types of authorization content in the request cannot be used in the detailed URL. They only respond when sent to the root path.

Using the RelativePath and Query options with Web.contents() in Power Query and Power BI M Code

let
	rooturl="https://xxxx.xxxx.com",
	Source = Web.Contents(url,
				[
					Headers = [#"Authorization"='token', #"Content-Type"="application/json"],
					RelativePath="/Api/arsys/entry/CTM:People",
					Query =
					[
						q =xxxxxx,
						id =xxxxxxx
					]
				]),
	issues = Source[issues]
in
    issues 

Best regards

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help 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.