Forum Discussion
Piotr_J
3 years agoRegular Visitor
PowerQuery - Unable to authenticate using HTTP Basic Authentication, POST method & Anonymous access
Dear All, I have created a Power Query to send a request via POST method using HTTP Basic Authentication and Anonymous access, however I'm still getting an error "We couldn't authenticate with the c...
ams1
3 years agoResponsive Resident
Hi Piotr_J
Great that you managed to confirm using Postman as it's a solid base for investigations.
Now, could you please share with us the cURL generated by Postman after you remove confidential information from it?
Piotr_J
3 years agoRegular Visitor
Hello ams1 ,
please see the cURL code from Postman:
curl --location 'https://test.calamari.io/api/clockin/timesheetentries/v1/balance' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic xxXXXXXxxxxXXXXxxxxXXXXXxxxxxxxxxxxXXXXXXXXXXXXXXXXXXXXX' \
--data '{
"from": "2023-01-01",
"to": "2023-01-31"
}'
I simplifid my Power Query:
let
actualUrl = "https://test.calamari.io/api/clockin/timesheetentries/v1/balance",
options = [Headers =[#"Authorization"="Basic xxXXXXXxxxxXXXXxxxxXXXXXxxxxxxxxxxxXXXXXXXXXXXXXXXXXXXXX",
#"Content-Type" = "application/json",
#"Accept" = "application/json"
]],
result = Json.Document(Web.Contents(actualUrl, options))
in
result
The #"Authorization" header contains Base64 value copied from the Postman, so the credentials are correct.
Nevertheless, I'm still unable to authenticate using this query and Anonymous method.
Best Regards
Piotr