Just to verify what it means by URI I used the wiki page. It is everything in the URL proceeding the domain name, including the first forward slash character.
So I enter the domain name in the web service.
And the URI in the URI field.
But this returns a 500 error.
Where if I enter everything into the chrome URL field on the same server as one string, the server correctly responds.
Update. Running the following C# Code works from the same workflow server but I MUST set the connection to use TLS or I get the same error, which in Wireshark shows that it is a reset request. I am wondering if the problem is because I have the wrong SSL configuration in the http request activity. Do I need to tell it to use TLS somewhere, I thought that was determined by the Web Server, not the user.
protected override void Execute()
{
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls11;
// Write your code here.
string output = GetUsers();
SetToken("output",output);
}
public string GetUsers()
{
var req = WebRequest.Create("https://app.asana.com/api/1.0/users");
SetBasicAuthentication(req);
return new StreamReader(req.GetResponse().GetResponseStream()).ReadToEnd();
}
void SetBasicAuthentication(WebRequest req)
{
var authInfo = apiKey + ":";
var encodedAuthInfo = Convert.ToBase64String(
Encoding.Default.GetBytes(authInfo));
req.Headers.Add("Authorization", "Basic " + encodedAuthInfo);
}