Reference Guide - Request validation

From SRP API Docs

Request validation

API validates request for:

  • Invalid format parameters
  • Out of range parameters
  • Parameter business rules
  • Parameter set business rules

If any invalid parameters are detected, status 400 will be sent with Bad request. Response will contain following validation element:

  <status code="400">Bad request</status>
  <validation>
    <PropertyName>ErrorMessage</PropertyName>
  </validation>
  • PropertyName - name of invalid parameter
  • ErrorMessage - error message

Sample request for Maturity Date property:

maturity=01-01-2012

Sample response:

  <status code="400">Bad request</status>
  <validation>
    <maturity>Date '01-01-2012' has invalid format for 'maturity'. Must be yyyy-MM-dd</maturity>
  </validation>