Animal
Register an animal
Response Codes and Explanations
Animal Registration is the event of an animal being reported to the system. The user can submit the request to register an animal in either synchronous or asynchronous mode.
Following submission of the animal registration using POST /animals, the system will validate the data content and return an immediate response indicating whether the content has been accepted for validation in case of async or the actual output in case of sync. The following response codes are possible:
- Code 200. This response indicates the registration request submission has been successful, and the response contains the unique animal identifier for the registered animal.
- Code 202. This response indicates that the data content has passed an initial syntax check and has been successfully queued by the system for further processing. The requestid field in the response contains a unique identifier generated by the system that the caller can use to track the progress of the registration request as it is validated by the system.
- Code 400. This response indicates that the submission has been rejected by the system because some or all of the data supplied was found to be in error. The Error structure in the returned message provides a list of error codes, along with a textual description of each error. Additional information is provided in the errors, identifying the field or fields in the original submission that generated each error. Following an error response, the system discards the submitted data. The caller must correct the errors identified and resubmit the registration.
- Code 500. This response indicates that something went wrong with the internal server and the request should be resubmitted.
In case when the request is submitted in async mode and once the registration request has been accepted by the system, the caller then calls GET /requeststatus/{requestId} repeatedly to track its progress through the validation process. The requestId parameter is the unique identifier returned in response to a successful POST /animals. This is used by the system to identify the transaction that is being queried. To prevent overloading the system, the caller should call GET /requeststatus/{requestId} a frequency no less than specified in the return parameter X-Retry-After.
Request Response Structure
Consider a scenario where a keeper registers an animal born at the holding (within the statutory time limit).
To register an animal, use the POST /animals endpoint, supplying the following information in the content body, with the resulting response:
Transaction Description |
Keeper registering an animal at a holding |
API / Endpoint |
POST /animals |
Header |
x-Request-Mode : async |
Content |
|
Response 202 |
OK - Successful operation, async request has been accepted. Response headers contain request-id and retry-after to check the request status afterwards Request id - used to check status of this request afterwards |
Payload Details
Field | Description |
---|---|
Species | The species of the animal (e.g., 'cattle') that was registered |
Name | Name of the animal (if provided by keeper during registration) |
Sex | Sex of the registered animal |
ProductionType | The type of livestock production a herd or animal is being kept for (for e.g. (Dairy, Meat, Beef, Laying) |
IdentificationDate | ?? |
geneticDam | Female parent of an animal (Mother) |
Sire | Male parent of an animal (Father) |
surrogateDam | A surrogate dam in livestock is an animal that carries a cloned embryo |
birthSite | Details of the Site where animals were born |
SiteIdentier | Unique Identifier for the type of Site |
SiteIdentifierType | Type of Site - One of ("fsaNumber", "holdingNumber", "portNumber" "lipNumber") |
birthDate | Date of Birth of the animal being registered |
birthYear | Birth Year of the animal being registered |
birthMark | Mark of the animal being registered |
assistedBirthFlag | If assistance was needed during the birth of the animal being registered |
multipleBirthFlag | if a birth was accompanied by more than one birth from the same dam. |
registrationSiteIdentifier | Unique identifier of the site where the animal was registered |
registrationDate | Date of animal's registration |
registrationCategory | One of: “birthRegistration”, “registration” |
receivedDate | Date when the registration request was received by Livestock Information Services |