Forum Discussion
Access data from POST API
- Anonymous5 years ago
HI Anonymous,
>>DataSource.Error: The downloaded data is HTML, which isn't the expected type. The URL may be wrong or you might not have provided the right credentials to the server.
Perhaps this issue appears when you try to use the wrong connector to recognize response data.
I'd like to suggest you navigation to the 'Source' step to confirm the result type and change to the corresponding connector in the next steps to recognize/analytics records.Regards,
Xiaoxin Sheng
Hi Anonymous,
Thank you for the suggestion, But it gives the error,
What I have tried:
let
url = "https://clientwebsitename.azurewebsites.net/",
body = "{
""grant_type"": ""client_credentials"",
""TenantId"": ""Client2"",
""UserSignon"": ""corp2019"",
""Password"": ""test""
}",
GetJson = Web.Contents(url,
[
Headers = [#"Content-Type"="application/raw"],
Content=Text.ToBinary(body),//use the sent parameters and name as you do in postman to replace current Authorization
RelativePath="dev/auth/user/authenticate"
]
),
token = Json.Document(GetJson)['jwt'],
Source = Web.Contents(url,
[
Headers = [#"X-Token"=token, #"Content-Type"="application/json"],
RelativePath="dev/masterdata/departments/get"
]
),
Result=Json.Document(Source)
in
Result
The Query is run successfully when suppressed the ['jwt'] from 2nd query and It generated the 2 Token with Value as below
The problem is ['jwt] is not worked, it gives error as" Invalid Identifier".
Thanks
Hi Anonymous,
My fault, it seems like I added additional characters '' in the sample formula. In fact, the '' characters are not needed. Please use [jwt] to replace ['jwt'] and try again.
BTW, please do mask on the sensitive data from your sample formal and snapshots.
Regards,
Xiaoxin Sheng
- Anonymous5 years agoNot applicable
Thank you Anonymous,
But it is still showing the following error:
DataSource.Error: The downloaded data is HTML, which isn't the expected type. The URL may be wrong or you might not have provided the right credentials to the server.
Thanks
- Anonymous5 years agoNot applicable
HI Anonymous,
>>DataSource.Error: The downloaded data is HTML, which isn't the expected type. The URL may be wrong or you might not have provided the right credentials to the server.
Perhaps this issue appears when you try to use the wrong connector to recognize response data.
I'd like to suggest you navigation to the 'Source' step to confirm the result type and change to the corresponding connector in the next steps to recognize/analytics records.Regards,
Xiaoxin Sheng
- Anonymous5 years agoNot applicable
Thank You Anonymous
Now it works.
Thanks a Lot.