Forum Discussion
Power Query REST API with Token and additional value - How to add this additional value?!
- 5 years ago
Hi Chiniminiz
It seems this additional part should also be included in the Content value. See if these videos help:
Making a POST Request Using Power Query - YouTube
Send API POST Requests in Excel with Power Query - YouTube
Something like
Content=Json.FromValue({[xxx="xxxxx", action="running"]})
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi v-jingzhang,
with the video, other sources and a little bit try and error I got the connection.
The code is
let
Source =
Json.Document(
Web.Contents(
LoadURL,
[
Headers=[#"Content-Type"="application/json",
#"Origin"= "Servername.domain.de",
#"X-Best-Auth" = "#SecurityKey"],
Content= info
]
)
),
in
Source
The problem was, to give the REST API the correct content (Body). This must be in a JSON format. So we needed a Table, which has to be converted into JSON format, which forward to the API in the Content.
Also the Origin and the Auth-Code has to be used in the Header and not like usually in the Content.
Thanks for your help and hopefully I help with this post others with an similar problem.