I am trying to access the Asana api. In order to do that I need to send http requests of the form
https://api end point “Authorization: Bearer 0/123456789abcdef”
I have tried setting Authetication → <|“Authorization” → Bearer… |> but that just brings up the asana sign in box. I also tried “Headers” → “Authorization: Bearer…” |> but that throws the error
HTTPRequest::nvldheaders: – Message text not found – (Join[{user-agent->Wolfram HTTPClient 12.},Authorization: Bearer …
What is the correct way to include the Authorization header request in the message?
I am trying to reproduce that in WL. My current attempt is:
header = <|“Headers” → {“Authorization: Bearer 0/123456789abcdef”}|>
URLExecute[“https://app.asana.com/api/1.0/users/me”, header]
Can you see anything wrong with my code, and also is there a way to get Mathematica to show me exactly what it is sending to Asana?
Please note, Asana requires a Get rather than a Post, hence the change to Neil’s code. Also, using the Personal Access Token (PAT) means that you don’t need to send the username and password