Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

2 REPLIES 2
Deelip_burla
Frequent Visitor

Hi , I need to connect API to power BI by using the following credentails using "POST"method. Please let me know how can i connect to power bi.

I have API url , endpoint, and API key.

 

API URL: https://el.api.cloud.net/hsm/odata/v2.0/Loc

API Key: aef579dh799dgah123hdg

and below is the header deatils

 

{
"name": "GetLoc",
"request": {
"method": "POST",
"header": [
{
"key": "requestHeader",
"value":"companyId,<integer>,
userGuid,<string>,
environment,<string>,
userToken,<string>,
subscriptionKey,<string>,
version,<string>"
},
{
"key": "Content-Type",
"value": "application/json"
},
{
"key": "Accept",
"value": "application/json;odata.data=minimal;odata.streaming=true"
},
{
"key": "s-api-key",
"value": "{{h-api-key}}",
"type": "default"
},
{
"key": "Version",
"value": "{{Version}}",
"type": "default"
},
{
"key": "CompanyId",
"value": "{{CompanyId}}",
"type": "default",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "{\n \"take\": 200,\n \"skip\": 0,\n \"filters\": {\n    \"startDate\": \"1/1/2024\",\n    \"endDate\": \"1/1/2025\"\n }\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{hsmBaseURL}}/Locations",
"host": [
"{{hsmBaseURL}}"
],
"path": [
"Locations"
]
}
},
"response": []
},

lbendlin
Super User
Super User

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.