Quantcast
Channel: Topliners : All Content - All Communities
Viewing all articles
Browse latest Browse all 3420

REST API - Validation and Error Messages

$
0
0

In most cases, Eloqua's REST API will respond to requests with the standard HTTP status code definitions.

If the API fails to validate a request, it will respond with a validation message (JSON or XML) describing the issue.

The following HTTP status code definitions should be helpful in trouble-shooting your issues.

 

Common HTTP Status Codes

 

CodeText
200OK
304Not Modified
400Bad Request
401Unauthorized
403Forbidden
429Too Many Requests
500Internal Server Error
502Bad Gateway
503Service Unavailable

 

 

400 Validation Errors

These failures are the most common and will respond with some details, including a list of validation messages.

See the examples below :

 

    [      {      "type":"EndpointValidationError",      "parameter":"syncActionType",      "value":"thisIsNotValid",      "requirement":{      "type":"EnumRequirement",      "values":["add","remove",...]    }    }  ]

Or

    [      {      "type":"ObjectValidationError",        "property":"emailFieldId",        "value":"0",        "requirement":{        "type":"IdRequirement"        },    "container": {    "type": "ObjectKey",    "objectType":"Email",    "objectId":"1"    "container": {    "type": "ObjectKey",    ...    }    },    }
]

 

Error Types

  • EndpointParameterError : caused by incorrect input parameters
  • BooleanRequirement : the value must be either "true" or "false"
  • ContentRequirement : the content supplied is blacklisted
  • DateRequirement : the value must be a proper date
  • IdRequirement : the value must be an integer greater than 0
  • ImmutabilityRequirement : the value cannot be changed once it has been set
  • IntegerRequirement : the value should be an integer
  • NoDuplicatesRequirement : there is a duplicate value supplied in the request
  • NotNullRequirement : the value cannot be null or missing
  • ObjectValidationError : a problem with one of the properties on the object
  • RelationshipRequirement : a relationship between two objects or related properties has not been met
  • SyntaxRequirement : the HTML is not valid or could not be parsed
  • UniquenessRequirement : the supplied name is not unique
  • UrlRequirement : the supplied value should be a valid url

 

We hope that you find this helpful.

 

Thanks,

Fred


Viewing all articles
Browse latest Browse all 3420

Trending Articles