Forum Discussion

Digger's avatar
Digger
Post Patron
5 years ago

Expression.Error: We cannot convert the value "{"integration_key":"..." to type Binary

How to send post request to Ebax api?

https://ebanx.github.io/api-reference/#tag/Payout/paths/~1ws~1payout~1search/post

 

 

let
Sorce = __Credentials,
#"Filtered Rows1" = Table.SelectRows(Sorce, each ([Provider] = "EbanX")),
header = [ #"Content-Type"="application/json", Accept="application/json"],
gBaseUrl = "https://api.ebanxpay.com//ws/payout/search",
/*Post_data = "integration_key=" & #"Filtered Rows1"[Login]{1}
& "&date_from=" & DateTime.ToText(RangeStart,"yyyy-MM-dd")
& "&date_to=" & DateTime.ToText(RangeEnd,"yyyy-MM-dd"),*/ //like string also not work
vOptions = [
Headers=header,
ManualStatusHandling = {400, 404},
//RelativePath = "/ws/payout/search", // not help
Content = Text.FromBinary(Json.FromValue([
integration_key = #"Filtered Rows1"[Login]{0},
date_from = DateTime.ToText(RangeStart,"yyyy-MM-dd"),
date_to = DateTime.ToText(RangeEnd,"yyyy-MM-dd")
]))
],
response = Web.Contents(gBaseUrl,vOptions)
in
response

 

 

i got error

 

Expression.Error: We cannot convert the value "{"integration_key":"..." to type Binary.
Details:
Value={"integration_key":"mykey","date_from":"2020-01-01","date_to":"2022-01-01"}
Type=[Type]

 

How to fix that?

3 Replies