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
Manand
Regular Visitor

Database connection failed while connecting REST API using POST method with Authentication key.

Hi All,

 

I am trying to connect a REST API to Power BI using POST method - 

i have the following details - 

webURLhttps://mis.domain.com/fms-mobile/profile/searchPerson/

API header - Content-Type: application/x-www-form-urlencoded

API Key - xxxxxxx

Request body - inputParam: {"searchValue":"0","searchId":"0","employeeCode":"0","apiKey":"xxxxxxxx","offset":"0","personId":"0"}

 

The API should return one of 2 options - and on success, it must display the results.

{

               "failure": {

                               "failure_status": 0,

                               "failure_message": ""

               },

               "success": {

                               "success_status": 1,

                               "success_message": ""

               },

            "result_data":[ ....

 

I have written the following code in the advanced editor -

let   

Query1 = Json.Document(Web.Contents("https://mis.domain.com/fms-mobile/profile/searchPerson/", [Headers = [#"Content-Type"="application/x-www-form-urlencoded"],

Content = Text.ToBinary("""inputparam"":{""searchValue"":""0"",""searchId"":""0"",""employeeCode"":""0"",""apiKey"":""xxxxxxx"",""offset"":""0"",""personId"":""0""                })]       

))

in Query1

 

This code is fetching the API information, however giving the result as database connection failed.

Manand_0-1645614446779.pngManand_1-1645614464738.png

I am unable to understand what the issue is. Request if anyone could help!!

 

Regards,

Manand

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

That seems to be a problem on "their" side.  Check with the API owner.

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

That seems to be a problem on "their" side.  Check with the API owner.

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.