All Versions

Version 1
Version 2


Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Error responses which include a body will use this model to provide helpful information about the cause of the error. Not all errors will include a body. Refer to the section on Error Handling to see which errors will and will not include a body in the response.

Data Model

NameTypeDescription
errorCodeError CodesShort descriptive error code, suitable for use in conditional logic in your error handling procedures.
errorMessagestringUser-friendly description of the error which may be useful for troubleshooting.
failedValidationsarray of Failed ValidationsList of the validations that failed. This is only included in the response when appropriate.

Error Codes

Error CodeHTTP StatusDescription
bad-request400Something was wrong with the request. More details will be provided in the errorMessage. You should not resend the request without modifications to correct the error.
authorization-required401The Authorization header is missing. For more information, please refer to the section on Authentication.
basic-authorization-required401The Authorization header must specify type Basic. For more information, please refer to the section on Authentication.
invalid-authorization401The Authorization header could not be decoded. Please check for proper encoding. For more information, please refer to the section on Authentication.
invalid-credentials403An invalid username or password was used to create the authorization token. For more information, please refer to the section on Authentication.
access-denied403Valid credentials were provided, but do not have the necessary permission to access the requested resource.
invalid-resource404

The requested resource has not been defined. Example: request for /a or /a/aid is not found because there is no resource of type a.

not-found404The resource with the requested ID does not exist. Example: request for /a/aid is not found because a is a valid resource type, but aid is not a valid id for that resource.
method-not-allowed405The method (verb) is not allowed for the requested resource. Do not resend the request.
identifier-required405The method (verb) is not allowed for this resources unless you provide a valid identifier as a part of the URI. Do not resend the request without adding an identifier.
not-acceptable406The Accept header does not specify a supported media type for the response
version-not-acceptable406The Accept-Version header does not specify a supported version for the response
invalid-content-typeencoding415The request body cannot be successfully decoded based on the specified Content-Type is not supported for this request. If Content-Type was not specified, application/json is assumed.
invalid-content-versiontype415The specified Content-VersionType is not supported for this request.
invalid-content-encodingversion415The request body cannot be successfully decoded based on the specified Content-Type. If Content-Type was not specified, application/json is assumedVersion is not supported for this request.
invalid-content415422The request body was successfully decoded, but could not be understood based on the Content-Version that was specified. If Content-Version was not specified, 1.0 is assumed.
invalid422The data provided in the request body has failed validations. Additional details can be found in failedValidations of the response body.

Failed Validations

The validation model is used to return specific details about POST, PUT, and PATCH requests which fail due to violations of data validation. It will let you know specifically which fields failed validation and why.

NameTypeDescription
validationenumeration

The type of validation which failed. Valid types are listed below under Validations.

dataElementstringThe name of the field from the data model which failed validation.
valuestringThe value provided for the data element which failed validations. This will always be returned as a string regardless of the element's actual data type.

 

Validations

This is a list of the validations that may be returned.

Failure CodesDescription
duplicateThe value being inserted or updated for the data element must be unique.
invalidAn otherwise unspecified validation has failed for the data element. Refer to the appropriate resource documentation for a description of valid values.
invalid-date A value provided for a date element is using a proper format but represents an invalid date.
invalid-formatA value provided for a date or dateTime element does not match a valid format.
invalid-timeA value provided for a dateTime element is using a proper format but represents an invalid dateTime.
out-of-rangeThe value provided does not fall within an acceptable range. Refer to the appropriate resource documentation for a description of valid values.
requiredA required value is missing from the request or was provided with an empty or null value.
update-not-allowedUpdates are not allowed to the data element.

 

Examples

UI Tabs


UI Tab
titleJSON


No Format
{
	"errorCode": "invalid",
	"errorMessage": "The input data has failed validations; See failedValidations for details",
	"failedValidations": [
		{
			"validation": "invalid",
			"dataElement": "country",
			"value": "XX"
		}
	]
}




 Document Revision History

Change History


Excerpt
hiddentrue

Consistent data format for all error responses which provide response bodies