Skip to content

Instantly share code, notes, and snippets.

@dsaiztc
Created May 30, 2017 16:14
Show Gist options
  • Save dsaiztc/1658f95f5aaa68831241343fe0400fe4 to your computer and use it in GitHub Desktop.
Save dsaiztc/1658f95f5aaa68831241343fe0400fe4 to your computer and use it in GitHub Desktop.
Google JSON API guide

StackOverflow answer

Success response return data

{
  "data": {
    "id": 1001,
    "name": "Wing"
  }
}

Error response return error

{
  "error": {
    "code": 404,
    "message": "ID not found"
  }
}

and if your client is JS, you can using if ("error" in response) {} to check if there is error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment