Reference Not Resolved

A reference couldn't be resolved for a given name or key

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

Summary

Receiving this error code means a value for a key or name has been supplied that does not match any records in the system.

For example when requesting an absence and a Reason has been supplied that does not match any reason in the system, for that absence type, the validation will fail and this error code will be returned.

curl -X POST -H "Content-Type: application/json" \
  --data "{ \"Reason\": \"Invalid\"}" \
  https://localhost:44336/Absences/Requests

{
  "error": {
    "code": "YM1000",
    "reference": "https://developer.youmanage.co.uk/api/errors/ym1000",
    "target": null,
    "message": "Validation failed",
    "details": [
      {
        "code": "YM1003",
        "reference": "https://developer.youmanage.co.uk/api/errors/ym1003",
        "target": "Reason",
        "message": "A reference could not be resolved for the given name or key",
        "details": null
      }
    ]
  }
}

   

Solution

In the above example, an invalid Reason has been sent and the validation error is returned, as the system could not match the name "Invalid" to any of the Holiday reasons in the system. 

The request should be amended with a valid Reason and reissued.