Forum Discussion
Anonymous
4 years agoNot applicable
Create a Post request with application/x-www-form-urlencoded
Hello, i need to get data from Pôle Emploi API, i succesfuly done it with GET. But i need to provide a token to make the GET. So i genereate the token with a POST in POSTMAN and it work well. Know ...
- 4 years ago
Hi Anonymous
Remove the "{}" in Json.Document function. This should work.
let url = "https://entreprise.pole-emploi.fr/connexion/oauth2/access_token?realm=/partenaire", headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "*/*"], postData = [ grant_type = "client_credentials", client_id = "PAR_xxxxx_xxxxxxxx", client_secret = "xxxxxxxxxxx", scope = "application_PAR_xxxxx_xxxxxxxx api_romev1 nomenclatureRome" ], response = Json.Document(Web.Contents(url, [ Headers = headers, Content = Text.ToBinary(Uri.BuildQueryString(postData)) ])) in responseRegards,
Jing
Anonymous
4 years agoNot applicable
Here is what i send :
And the next step with error :
Now i show how i proceed with postman :
v-jingzhang
4 years agoCommunity Support
Hi Anonymous
Remove the "{}" in Json.Document function. This should work.
let
url = "https://entreprise.pole-emploi.fr/connexion/oauth2/access_token?realm=/partenaire",
headers = [#"Content-Type" = "application/x-www-form-urlencoded", #"Accept" = "*/*"],
postData = [
grant_type = "client_credentials",
client_id = "PAR_xxxxx_xxxxxxxx",
client_secret = "xxxxxxxxxxx",
scope = "application_PAR_xxxxx_xxxxxxxx api_romev1 nomenclatureRome"
],
response = Json.Document(Web.Contents(url,
[
Headers = headers,
Content = Text.ToBinary(Uri.BuildQueryString(postData))
]))
in
response
Regards,
Jing
- Anonymous4 years agoNot applicable