java-asana
java-asana copied to clipboard
java.net.SocketException: Connection reset
The exception started to throw at September, 30 on production that uses API KEY. Until that it worked properly. Neither API KEY (that is going to be deprecated, as far as I know) nor Personal Access Token helped to resolve the problem.
This occurs each time when try to get response from Asana Api (for example GET https://app.asana.com/api/1.0/workspaces).
┆Issue is synchronized with this Asana task
Hi Gleb! Have you managed to get a response using different credentials (with OAuth perhaps)? What is the output (excluding sensitive data) of curl -v https://app.asana.com/api/1.0/workspaces
from the machines where your code is running?
This happens for me also. I can use curl
to execute the "me" request:
curl -H "Authorization: Bearer MY_PERSONAL_ACCESS_TOKEN_HERE" https://app.asana.com/api/1.0/users/me
but the same in the sample does not work:
public class ExamplePersonalAccessToken {
private static String asana_access_token="MY_PERSONAL_ACCESS_TOKEN_HERE";
public static void main(String[] args) throws Exception {
System.out.println("== Example using a personal access token:");
Client client = Client.accessToken(asana_access_token);
User me = client.users.me().execute();
System.out.println("me=" + me.name);
}
}
This sample was working in August. My test this morning was with a fresh personal access token (validated by the fact I can use it via curl) and with a fresh clone of your project.
Looks like the code is working this morning. Unreliable API? Did Asana fix something?
Any updates here? This happens for me also. Here is example code in Groovy:
Client client = Client.accessToken(token);
client.projects.findAll().each {
println it.name
}
Got the same problem when call directly to API
RESTClient http = new RESTClient("https://app.asana.com/api/1.0/projects")
http.get(headers: ["Authorization": "Bearer $token"]) { reps, data ->
println "data ${data}"
}