Hi - I’m calling the rest api from some java code hosted on google cloud. A few weeks ago, it was running successfully, yet today I run the same code and I get a 404 from the trello api call. If I curl (or use postman) the same URL from within cloud shell it successfully returns the data.
Any ideas?
code:
import java.io.IOException;
import java.lang.System.Logger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Collectors;
import java.util.List;
import java.util.Optional;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpResponse;
import java.net.http.HttpRequest;
public class tester123 {
public static void main(String[] args){
try{
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(
URI.create(
"https://api.trello.com/1/boards/**boardid**/cards?key=**key**&token=**token**"
))
.header("accept", "application/json")
.build();
// use the client to send the request
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());
if( response.statusCode() == 404){
System.out.println("ScanBoards: Failed to get data from Trello"+response.toString());
}
else{
System.out.println("ScanBoards: Got board data from Trello"+response.toString());
}
}
catch(Exception e){System.out.println(e);}
//+boards.get(0).getPrefs());
}
}