Skip to content

Error Codes

Hongsuda edited this page Apr 27, 2015 · 11 revisions

Error Handling

JSON response structure

Notice that the errors element is an array. This will be deprecated in a future release because in practice the ohmage APIs never return more than one error.

{
    "errors":[
        {
            "code":0000,
            "text":"explanatory text"
        },
        ...
    ]
}

Error codes are composed of a four digit code where the first two digits indicate the error domain and the last two digits indicate the specific error within that domain.

Unknown System Errors

  • No response. This can occur in the case of a networking issue (timeout, DNS error).
  • HTTP 500 Server Error. This can occur in the case of a server logical error. In cases where known exceptions occur, the server will attempt to respond with error code 103. However, there are certain cases where it may not be possible. An HTTP 500 error indicates a serious problem.

System - 01xx

  • 0100 - General server error.
  • 0101 - System request too large.

Authentication - 02xx

  • 0200 - Authentication failed.
  • 0201 - Account disabled.
  • 0202 - New account. User must change password.

Invalid Parameter That is Used Across Multiple Requests - 03xx

  • 0300 - Invalid JSON data
  • 0301 - Invalid client
  • 0302 - Invalid date
  • 0303 - Invalid timestamp
  • 0304 - Invalid time
  • 0305 - Invalid timezone
  • 0306 - Invalid location status
  • 0307 - Invalid location
  • 0308 - Invalid number to skip.
  • 0309 - Invalid number to return.
  • 0310 - Invalid CAPTCHA.
  • 0311 - Self-registration not allowed.
  • 0312 - Invalid redirect.

Mobility - 05xx

  • 0500 - Invalid subtype
  • 0501 - Invalid mode
  • 0502 - Invalid accelerometer data
  • 0503 - Invalid speed

Survey - 06xx

  • 0600 - Invalid responses
  • 0601 - Invalid output format
  • 0602 - Invalid pretty print value
  • 0603 - Invalid survey ID
  • 0604 - Invalid prompt ID
  • 0605 - Invalid column ID
  • 0606 - Invalid privacy state
  • 0607 - Invalid sort order
  • 0608 - Invalid suppress metadata value
  • 0609 - Invalid return ID
  • 0610 - Invalid collapse value
  • 0611 - Invalid survey key value
  • 0612 - Invalid survey function ID
  • 0613 - Too many users in query
  • 0614 - No users in query
  • 0615 - Too many prompt IDs
  • 0616 - Too many survey IDs
  • 0617 - Insufficient permissions
  • 0618 - Either a prompt id list or a survey id list must be present, but not both
  • 0619 - Invalid survey launch context
  • 0620 - Invalid survey launch context launch time
  • 0621 - Malformed user_list
  • 0622 - Malformed prompt_id_list
  • 0623 - Malformed survey_id_list
  • 0624 - Malformed column_list
  • 0625 - Invalid privacy state group item
  • 0626 - Repeatable set ID
  • 0627 - Invalid repeatable set iteration
  • 0628 - Invalid image value
  • 0629 - Invalid prompt response search
  • 0630 - Invalid survey-prompt map

Campaign - 07xx

  • 0700 - Invalid ID (i.e., invalid campaign URN)
  • 0701 - Invalid name
  • 0702 - Invalid XML
  • 0703 - Invalid running state
  • 0704 - Invalid privacy state
  • 0705 - Invalid output format
  • 0706 - Invalid role
  • 0707 - Insufficient permissions
  • 0708 - Cannot change campaign ID or name when updating XML
  • 0709 - Invalid description
  • 0710 - Campaign is out of date (a new campaign with the same URN and a newer (or different) timestamp is stored in the server db)
  • 0711 - Invalid authored by value
  • 0712 - Invalid survey ID
  • 0713 - Invalid prompt ID

Image - 08xx

  • 0800 - Invalid ID
  • 0801 - Invalid size
  • 0802 - Insufficient permissions
  • 0803 - Invalid data

Class - 09xx

  • 0900 - Invalid ID
  • 0901 - Invalid name
  • 0902 - Invalid description
  • 0903 - Invalid role
  • 0904 - Invalid roster
  • 0905 - Insufficient permissions
  • 0906 - Invalid with user list value

User - 10xx

  • 1000 - Invalid username
  • 1001 - Invalid password
  • 1002 - Invalid admin value
  • 1003 - Invalid enabled value
  • 1004 - Invalid new account value
  • 1005 - Invalid campaign creation privilege value
  • 1006 - Invalid first name value
  • 1007 - Invalid last name value
  • 1008 - Invalid organization value
  • 1009 - Invalid personal ID value
  • 1010 - Invalid email address
  • 1011 - Invalid JSON data
  • 1012 - Insufficient permissions
  • 1013 - User not in campaign
  • 1014 - Invalid registration ID
  • 1015 - Invalid delete personal info
  • 1016 - Invalid class creation privilege
  • 1017 - Invalid user setup privilege

Document - 11xx

  • 1100 - Invalid ID
  • 1101 - Invalid name
  • 1102 - Invalid contents
  • 1103 - Invalid privacy state
  • 1104 - Invalid description
  • 1105 - Invalid role
  • 1106 - Invalid personal documents value
  • 1107 - Insufficient permissions
  • 1108 - Missing campaign-role and class-role list

Visualization - 12xx

  • 1200 - Invalid width
  • 1201 - Invalid height
  • 1202 - General error
  • 1203 - Invalid aggregate value

Audit - 13xx

  • 1300 - Insufficient permissions
  • 1301 - Invalid request type
  • 1302 - Invalid URI
  • 1303 - Invalid client value
  • 1304 - Invalid device ID value
  • 1305 - Invalid response type
  • 1306 - Invalid error code

Annotation - 14xx

  • 1400 - Invalid time
  • 1401 - Invalid timezone
  • 1402 - Invalid annotation
  • 1403 - Invalid ID
  • 1404 - Insufficient permissions

Observer - 15xx

  • 1500 - Invalid definition
  • 1501 - Insufficient permissions
  • 1502 - Invalid ID
  • 1503 - Invalid version
  • 1504 - Invalid name
  • 1505 - Invalid description
  • 1506 - Invalid version string
  • 1507 - Invalid stream ID
  • 1508 - Invalid stream version
  • 1509 - Invalid stream name
  • 1510 - Invalid stream description
  • 1511 - Invalid stream version string
  • 1512 - Invalid stream definition
  • 1513 - Invalid stream data
  • 1514 - Invalid column list
  • 1515 - Invalid chronological value
  • 1516 - Invalid preserve invalid points value

Video - 16xx

  • 1600 - Invalid ID

Open mHealth - 17xx

  • 1700 - Invalid payload ID
  • 1701 - Invalid start timestamp
  • 1702 - Invalid end timestamp
  • 1703 - Invalid column list
  • 1704 - Invalid summarize
  • 1705 - Invalid number to skip
  • 1706 - Invalid number to return
  • 1707 - Invalid requester
  • 1708 - Invalid payload version
  • 1709 - Invalid owner
  • 1710 - Insufficient permissions
  • 1711 - Account not linked
  • 1712 - Invalid data

Audio - 18xx

  • 1800 - Invalid ID
  • 1801 - Invalid duration
  • 1802 - Insufficient permissions
  • 1803 - Invalid content

Media - 19xx

  • 1900 - Invalid ID