Forum Discussion
nicolast29
4 years agoHelper V
post request
Hi folks, I wish to connect to our new software provider via Api https://docs.api.myunisoft.fr/#b953be72-03e7-4be6-8638-d14025bdab46 I have no problem to make get request, but the post didn't wo...
Anonymous
4 years agoNot applicable
Hi nicolast29,
I modify the code to split the URL to root and relativepath and add a query to the connection. You can try to use the following query if they suitable for your requirement:
let
vToken = "Bearer " & "TokenXXX",
vSecret = "SecretXXX",
vsociety = "XXXX",
rootURL = "https://api.myunisoft.fr/api",
relativePath = "/v1/export/FEC",
//vUrl = "https://api.myunisoft.fr?export_type=1&from=2021-01-01&to=2021-12-30",
Source =
Json.Document(
Web.Contents(
rootURL,
[
Headers = [
Authorization = vToken,
#"X-Third-Party-Secret" = vSecret,
#"society-id" = vsociety,
#"Content-Type" = "application/json"
],
RelativePath = relativePath,
Query = [
export_type = "1",
from = "2021-01-01",
to = "2021-12-30"
]
]
)
)
in
Source
Regards,
Xiaoxin Sheng
nicolast29
4 years agoHelper V
Thanks for your answer
I modify my code with your informations but i still have a reponse error:
DataSource.Error : Web.Contents n'a pas réussi à obtenir le contenu de « https://api.myunisoft.fr/api/v1/export/FEC?export_type=1&from=2021-01-01&to=2021-12-31 » (405) : Method Not Allowed
Détails :
DataSourceKind=Web
DataSourcePath=https://api.myunisoft.fr/api/v1/export/FEC
Url=https://api.myunisoft.fr/api/v1/export/FEC?export_type=1&from=2021-01-01&to=2021-12-31