Search code examples
google-glassgoogle-mirror-api

Timeline item update error


I have a bundle of timelineitems using Mirror API, Now I am trying to change content of a timeline from bundle. But the below error occurs

An error occurred from update timeline : com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found
{
  "code" : 404,
  "errors" : [ {
    "domain" : "global",
    "message" : "Not Found",
    "reason" : "notFound"
  } ],
  "message" : "Not Found"
}

And update method is something like below

public static TimelineItem updateTimelineItem(Credential credential,
        String itemId, String newText) {
    try {
        Mirror.Timeline timeline = getMirror(credential).timeline();
        TimelineItem timelineItem = timeline.get(itemId).execute();

        timelineItem.setText(newText);

        return timeline.update(itemId, timelineItem).execute();
    } catch (IOException e) {
        System.err.println("\nAn error occurred from update timeline : " + e);
        return null;
    }
} 

First I try to retrieve the timeline item, when I write execute, then the error occurred

Mirror.Timeline timeline = getMirror(credential).timeline();
TimelineItem timelineItem = timeline.get(itemId).execute();

How can I solve it?


Solution

  • It isn't completely clear from the exception you've posted, but it looks like the itemId isn't valid. How are you getting this itemId and can you verify if it is the timeline.get or the timeline.update that is causing the problem?