Error Messages
Introduction
Some HTTP error codes can be triggered by more than one condition. The Health Graph returns more detailed information about the error in the body of the response.
Note: Currently, the following response structure is used only for 403 Forbidden messages, which may happen under normal operation of an application. Machine-readable messages will be added for other response codes in the future; in the meantime, human-readable messages are provided. (Such responses generally indicate a programming error and should not be expected in a production environment.)
Error Messages
Error messages have the following structure:
| Field | Type | Description | |
|---|---|---|---|
reason |
String |
The reason for the error, as one of the following values: Revoked,
Insufficient permission |
Y |
delete_health |
Boolean |
If reason is Revoked, indicates whether the user
has requested that health and fitness information be deleted (not present for
other errors) |
Y |
Examples
User has Disconnected the Application, but Does Not Want to Delete Information
- Sample Request
-
GET /user HTTP/1.1 Host: api.runkeeper.com Authorization: Bearer xxxxxxxxxxxxxxxx Accept: application/vnd.com.runkeeper.User+json - Sample Response
-
HTTP/1.1 403 Forbidden Content-Type: application/vnd.com.runkeeper.ErrorMessage+json Content-Length: nnn { "reason":"Revoked", "delete_health":"false" }
User has Disconnected the Application, and Wants to Delete Information
- Sample Request
-
GET /user HTTP/1.1 Host: api.runkeeper.com Authorization: Bearer xxxxxxxxxxxxxxxx Accept: application/vnd.com.runkeeper.User+json - Sample Response
-
HTTP/1.1 403 Forbidden Content-Type: application/vnd.com.runkeeper.ErrorMessage+json Content-Length: nnn { "reason":"Revoked", "delete_health":"true" }
Application Does Not Have Sufficient Permission
- Sample Request
-
GET /fitnessActivities HTTP/1.1 Host: api.runkeeper.com Authorization: Bearer xxxxxxxxxxxxxxxx Accept: application/vnd.com.runkeeper.FitnessActivityFeed+json - Sample Response
-
HTTP/1.1 403 Forbidden Content-Type: application/vnd.com.runkeeper.ErrorMessage+json Content-Length: nnn { "reason":"Insufficient permission" }
