Example
Invalid Request to POST /patientfiles
{
"gender": "martian",
"name": {
"first": "@@"
}
}
Fault Response
{
"object" : "fault",
"name" : "validation",
"code" : "kValidationError",
"status" : 400,
"faults" :
[
{
"object" : "fault",
"name" : "validation",
"code" : "kRequired",
"status" : 400,
"reason" : "Required property",
"message" : "Please enter a value",
"path" : "dob"
},
{
"object" : "fault",
"name" : "validation",
"code" : "kRequired",
"status" : 400,
"reason" : "Required property",
"path" : "name.last"
},
{
"object" : "fault",
"name" : "validation",
"code" : "kEnumValue",
"status" : 400,
"reason" : "One of: m, f",
"path" : "gender"
},
{
"object" : "fault",
"name" : "fault",
"code" : "kInvalidString",
"status" : 500,
"reason" : "Enter text between 1 and 100 characters in length",
"path" : "name.first"
}
]
}
Faults generated from api requests are json documents with fault as the object property value.
When reading and writing context properties, a path property will usually be available, representing the full property path. A fault may also have children, especially in the case of kValidationError, where property validation errors are represented as children, whose path property can be examined to pinpoint the error source.
NoteThere are some faults, such as kNewLocation and kMediaNotReady, whose HTTP statuses are in the 2XX range. In these cases, clients must handle a seemingly successful response as a fault.
Source | Error Code | Status | Meaning |
---|---|---|---|
account | kAccountNotActivated | 403 | Account is not yet activated. |
account | kAccountNotVerified | 403 | Account connections can't occur until an account has been verified. |
account | kProviderRegistrationDisabled | 403 | Provider registration is not enabled. |
account | kSelfRegistrationDisabled | 403 | Self registration is not enabled. |
auth | kInvalidRequestSignature | 400 | Invalid request signature. |
auth | kStaleRequestSignature | 400 | Stale request signature. |
auth | kAccountLocked | 403 | Your account access has been disabled. |
auth | kInvalidCredentials | 403 | Invalid email/password combination. |
auth | kNoCredentialsSupplied | 403 | No access credentials were supplied. |
error | kIllegalExpansion | 400 | This property cannot be expanded. |
error | kInvalidArgument | 400 | Invalid Argument. Typically accompanied by a reason and path. |
error | kInvalidObject | 400 | Invalid or Unknown Object. |
error | kAccessDenied | 403 | Access to this resource is denied. |
error | kNotDeletable | 404 | Resource cannot be deleted. |
error | kNotFound | 404 | Resource not found. |
error | kNotPullable | 404 | Removal from collection not supported. |
error | kNotWritable | 404 | Resource is not writable. |
error | kTimeout | 408 | Timeout. |
error | kExists | 409 | Resource already exists. |
error | kStaleDocument | 409 | Stale document. Versioning error. |
error | kExpired | 410 | Resource expired. |
error | kRequestTooLarge | 413 | Request too large. |
error | kThrottled | 429 | Request throttled. Too many requests from the client. |
error | kError | 500 | Error. General error, accompanied by a "reason", and possible child faults. |
error | kNotImplemented | 501 | Not implemented. An unimplemented, undocumented and/or planned feature is part of the api, but not ready for release. |
error | kUnsupportedOperation | 501 | Unsupported Operation. |
error | kTooBusy | 503 | Too Busy. The server cannot respond to requests. Clients should scale back requests for a while. |
files | kMediaNotReady | 202 | File not ready. Not really an error. File processing occurs asynchronously, and depends on the file size, type, and facet processors. |
files | kMismatchedMediaContentType | 400 | Uploaded file content type must match the source. Occurs during processing if the uploaded file doesn't match the facet's expected content type. |
files | kMissingMediaSource | 400 | A file source is missing from the upload. Occurs when a File is configured with required facets that were not included in the upload request. |
files | kMediaTypeNotAllowed | 415 | This file type is not allowed. For example, a File facet expecting an image/png will produce this error if the uploaded type doesn't match. |
location | kNewLocation | 200 | A new location has been added to the account. 2FA is triggered. A subsequent sign in must use the location verification token. |
location | kCouldNotReadCookies | 400 | Could not read cookies. Cookies are required for sessions. |
location | kFingerprintMismatch | 400 | Fingerprint doesn't match session. |
location | kInvalidFingerprint | 400 | Invalid location fingerprint. |
location | kLocationAlreadyVerified | 400 | Location already verified. |
location | kLocationAccessRevoked | 403 | Access from this location has been revoked. |
location | kLocationClientMismatch | 403 | Location/Access client mismatch. Occurs if location jiggery pokery is attempted. |
location | kUnverifiedLocation | 403 | Access by this location is pending account holder verification. This occurs when a user signs in from a new location and attempts a login while the 2fA is still in progress. |
registration | kAccountActivationRequired | 403 | The account must be activated to login. |
registration | kRegistrationInvitationRequired | 403 | Registration requires a valid invitation. |
sessions | kCSRFTokenMismatch | 403 | CSRF token mismatch. This occurs is the client is configured to use CSRF protection and the client has not sent the correct Medable-CSRF-Token header. |
sessions | kLoggedInElsewhere | 403 | Logged in elsewhere. This can occur is the org is configure to sign out other client sessions. |
sessions | kNotLoggedIn | 403 | You must be logged in to access this resource. |
sessions | kSessionExpired | 403 | Your session has expired. |
sessions | kSessionOrgMismatch | 403 | The application and session Orgs don't match. |
sessions | kUnsafeGoodsDetected | 403 | Authorization security failure. |
sessions | kSessionRequired | 500 | A session is required to access the resource. |
validation | kCastError | 400 | Cast error. A request value could not be sanely converted. |
validation | kCreatableOnly | 400 | Property is only writable on creation. |
validation | kEnumValue | 400 | Please enter a value from the list. |
validation | kInvalidDateOfBirth | 400 | Invalid date of birth. |
validation | kInvalidDomainFormat | 400 | Invalid domain format. |
validation | kInvalidEmailFormat | 400 | Invalid email address format. |
validation | kInvalidFormat | 400 | Generic validation string format error. |
validation | kInvalidIPv4AddrOrCidr | 400 | Enter a valid IPv4 address or IPv4 CIDR range. |
validation | kInvalidJSON | 400 | Please enter valid JSON. |
validation | kInvalidJSONSchema | 400 | Please enter a valid JSON schema. |
validation | kInvalidNPI | 400 | Invalid NPI format. |
validation | kInvalidPhoneNumberFormat | 400 | Invalid phone number format. |
validation | kMaxAllowed | 400 | Too many documents in a document array. |
validation | kMaxItems | 400 | Too many items in a property array. |
validation | kMinItems | 400 | Not enough items in a property array. |
validation | kMinRequired | 400 | Not enough documents were provided for a document array. |
validation | kRequired | 400 | A required value is missing from the request. |
validation | kScriptCompilationError | 400 | Script compilation error. An uploaded script has failed to compile. |
validation | kValidationError | 400 | A validation error has occured. Typically, validation errors will have 1 or more child faults. |