I've been having a very difficult time sending a simple message to Glass and I suspect it has something to do with authorization request. Below is my code:
String AUTH="ya29.1.AADtN_WhePFbTxZdrM8wDWaVyBPgpyvph5EifU-CDQ4z9nbJxBXHLQLiaY3EDBk";
for (int i=5; i>0; i--)
{
String url = "https://www.googleapis.com/mirror/v1/timeline?fields=text";
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("X-JavaScript-User-Agent", "Google APIs Explorer");
con.setRequestProperty("Authorization", "Bearer " + AUTH);
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Content-Length", "26");
String urlParameters = "{ \"text\": \"Hello world\" }";
Unfortunately, it keeps throwing a 403 error. Any advice? Thanks.