Forum Discussion
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
- amitchandakSuper User
Digger , refer if this old solution can help
- DiggerPost Patron
amitchandak nope, not helpful
- AnonymousNot applicable
Hi Digger,
The problem should occur when Json.fromvalue() is converted to Binary and then parsed by Text.fromBinary().
Please check this step.
Also, here is a case with a similar problem, please see if it is helpful to you: We cannot convert the value "[Binary]" to type Binary
Best Regards,
Caitlyn Yan
If this post helps then please consider Accept it as the solution to help the other members find it more quickly.