Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hello everybody, i tried to connect to rest api using X-AUTH-TOKEN and POST method but i got this error :
Please specify how to connect
here is the code :
let
url = "https://centreon.xxxxxxx/centreon/api/v2/login",
GetJson = Web.Contents(url,
[
Headers = [#"Accept"="application/json",
#"Content-Type"="application/Json"],
Content = Text.ToBinary("{""security"": {""credentials"": {""login"": ""xxxxxxxx"",""password"": ""xxxxxxxx""}}")
]
),
FormatAsJson = Json.Document(GetJson),
// Gets token from the Json response
AccessToken = FormatAsJson[token],
AccessTokenHeader = "X-AUTH-TOKEN " & AccessToken,
GetJsonQuery = Web.Contents("https://centreon.xxxxxxxx/centreon/api/beta/monitoring/hosts/",
[
Headers = [#"Authorization"=AccessTokenHeader]
]
),
FormatAsJsonQuery = Json.Document(GetJsonQuery)
in
FormatAsJsonQuery
in postman i got the right result with this information
curl --location --request POST 'https://centreon.xxxxxxxx/centreon/api/v2/login' \
--header 'Content-Type: application/json' \
--data-raw '{
"security": {
"credentials": {
"login": "xxxxxxxxxx",
"password": "xxxxxxxxxxx"
}
}
}'
and
curl --location --request GET 'https://centreon.xxxxxxxx/centreon/api/beta/monitoring/hosts/' \
--header 'X-AUTH-TOKEN: xxxxxxxxxxxxxxxx'
Thank you in advance for your answers,
In case you still needed an answer for this...the following worked for me
let
Source = Json.Document(Web.Contents("{add URL here}", [Headers=[#"Content-Type"="application/json", #"X-ApiToken"="{add token here}"]])),
Hello,
I really hope you have found the solution. If yes, would you please share it with us ? I am facing the same problem.
thank you,
hi, i am sorry i did not find a solution for this problem but i proceeded otherwise to resolve it. indeed I used an etl (talend) to establish the connection with Centreon and to import the necessary data into my data warehouse to then retrieve them on power bi. I hope it can help you.
Good luck
Hi @Anonymous
You may refer to this blog for more details: Web Services And POST Requests In Power Query
You can try Anonymous access, for more details: Anonymous access
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.