Forum Discussion
Doc-tan
8 months agoRegular Visitor
Custom connector API - TOKEN (error binary)
I have create a custom connector but i can not see and use the token because of error Details: "We cannot convert a value of type Binary to type Text." at the postman i can post the same url wi...
- 8 months ago
I solved my problem with putting url, header and body in vars and used these in web.contents.
letcreds = Extension.CurrentCredential(),urlToken = Server &"SignIn",HeadersToken = [#"Content-Type" = "application/json",#"api-version" = "1.0"],BodyToken = Json.FromValue([username = creds[Username],password = creds[Password],afm = "",code = ""]),ResponseToken =Web.Contents(url,[Headers = HeadersToken ,Content = BodyToken]),JsonResponseToken = Json.Document(ResponseToken),Token = JsonResponseToken[token]inTokenThank for all your answers!!
Doc-tan
8 months agoRegular Visitor
I solved my problem with putting url, header and body in vars and used these in web.contents.
let
creds = Extension.CurrentCredential(),
urlToken = Server &"SignIn",
HeadersToken = [#"Content-Type" = "application/json",#"api-version" = "1.0"],
BodyToken = Json.FromValue([
username = creds[Username],
password = creds[Password],
afm = "",
code = ""
]),
ResponseToken =
Web.Contents(
url,
[
Headers = HeadersToken ,
Content = BodyToken
]
),
JsonResponseToken = Json.Document(ResponseToken),
Token = JsonResponseToken[token]
in
Token
Thank for all your answers!!