Value Must Not Be Empty

A non default value must be supplied

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

Summary

This error code signifies that although a value was supplied for a property it was either null or a default value. For example, the Name property of a Company entity will not allow a null value, nor will it allow an empty string.

curl -X PUT -H "Authorization: ApiKey {ApiKey}" \
  -H "Content-Type: application/json" \
  --data "{\"Name\": \"\"}" \
  https://api.youmanage.co.uk/companies/5

{
  "error": {
    "code": "YM1000",
    "reference": "https://developer.youmanage.co.uk/api/errors/ym1000",
    "target": "Validation",
    "message": "Validation failed",
    "details": [
      {
        "code": "YM1006",
        "reference": "https://developer.youmanage.co.uk/api/errors/ym1006",
        "target": "Name",
        "message": "'Name' must not be empty.",
        "details": null
      }
    ]
  }
}

  

Solution

Reissue the same request but ensure that a non-default value is supplied for the property.

curl -X PUT -H "Authorization: ApiKey {ApiKey}" \
  -H "Content-Type: application/json" \
  --data "{\"Name\": \"Awesome Inc.\"}" \
  https://api.youmanage.co.uk/companies/2

HTTP/1.1 204 No Content