Forum Discussion
Anonymous
3 years agoNot applicable
Defining today's date on advanced editor
Hey guys, I'm pulling data out of a POST API, and one of the requested headers is the date period that will be retrieved. Here's what I've got so far: let
url = "https://my.url.co...
Anonymous
3 years agoNot applicable
Hi Anonymous ,
Please have a try.
let
url = "https://my.url.com/Report/SomeReport",
body = "{""DtInicio"": #date(2022,10,1),""DtFim"": DateTime.LocalNow()}",
Source = Json.Document(Web.Contents(
url,
[Headers = [#"Content-Type"="application/json", #"Authorization"="XXXXXX-8784"],
Content = Text.ToBinary(body)]))
in
#"Source"
Check the value type.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
3 years agoNot applicable
Hey, Anonymous . Once again, thanks for your help.
I've replicated this code you provided me, but this error message pops up:
Details:
statusCode=500
mensagem=Unexpected character encountered while parsing value: #. Path 'DtInicio', line 1, position 13.
I've also tried to insert this symbol &, but it also bears in error:
body = "{""DtInicio"":" & #date(2022,10,1) & ",""DtFim"":" & DateTime.LocalNow() & "}",
Expression.Error: We cannot apply operator & to types Text and Date.
Details:
Operator=&
Left={"DtInicio":
Right=10/1/2022
Do you know what else can be done to make this error message disappear?