Invalid Value

The value supplied was not valid

Purple gradient wave Purple wave used to give a visual break between the header and body of the page.

Summary

When the API returns this error code it means that you have supplied a value that is not valid for that property.

For example if you are attempting to update an Employee to change their Status the system will only allow a value of either "Current" or "Former" and if you supply any other value the system will return this error as seen below:

curl -X PUT --data "{\"Status\": \"Invalid\" }" https://api.youmanage.co.uk/Employees

{
  "error": {
    "code": "YM1000",
    "reference": "https://developer.youmanage.co.uk/api/errors/ym1000",
    "target": "Validation",
    "message": "Validation failed",
    "details": [
      {
        "code": "YM1004",
        "reference": "https://developer.youmanage.co.uk/api/errors/ym1004",
        "target": "Status",
        "message": "An invalid value was supplied",
        "details": null
      }
    ]
  }
}

   

Solution

Rewrite the request using a valid value for the property being updated.