API

BoviSync API Best Practices

Before starting to consume the BoviSync API, it is recommended you create a user account and get familiar with the Bovi-Insights reporting that is the reporting UI that is fed by the BoviSync API.  In doing this you will be able to answer your own questions more easily.  Additionally, by clicking on the eartag of an animal, you can see its cow page. Doing this can add context for why does a report item return X, Y, or Z.

After you have familiarized yourself with Bovi-Insights and BoviSync data, you want to start getting data from BoviSync.  BoviSync’s data is extremely transactional.  There are almost no stored ‘items’.  For example, if you want to see the animal’s genomic tissue sample ID, there is a calculated animal report item for this.  However, it is stored on the tissue sample event with the field values of ‘Genomic’ for the type of test and the sample ID is in the sample ID field.  There you could find the animal has been sampled twice and by utilizing the event transactional data, you can get more data.  

There are hundreds of calculated items that are created for user convenience.  And there is functionality to create your own items (try doing this yourself in Bovi-Insights first, documentation in in the UI) using excel like formula syntax.  This creates the opportunity for both infinite report items and the ability to put the logic you desire into an API request and get a result that already incorporates your requested logic.

BoviSync is a multi-tenant database that does not remove data for archiving, and because of its transactional nature, there isn’t transient data that is being over-written.  At any time, you can make an API call for a specific date and see the results as it would have looked on that date.  If I make a query for animals and their pens 16 months ago, all the dead animals show as being alive.  All the animals will show as being in that pen on the day you requested.  Because of this and the ability to have infinite report items, the logic used may be different that when data warehousing other more transient data that has limited depth or quality.

When querying the Animal report items, please refer to the attached excel sheet.  There is some logical grouping that can reduce the number of timeouts and improve the overall speed of querying the data.  If you have questions about specific items, refer to the Bovi-Insights reports to see what the description of the item is, and explore the animal’s page to see why the report items returns a particular value.  Most of these items are calculated data, with the exception of the genomic data and the animal’s pedigree and registration.

The event transaction data will return most of the data you are looking for.  Some of the fields values you can see in the API call are FK values to other internal tables that you don’t have API access to query the values to find them.  In those cases, you want to add an event report item.  For instance, on a bred event, the sire used is a FK value. By adding the NAAB sire code for the event as a report item, you can gain meaning from the value.  These two reports are recommended to be reviewed to see what items you would want to request for two groups of event types.  If you request these event types with the items in these reports, you will have requested nearly all the data for the farm.



There currently is not a DHI test endpoint.  However, you can access the test data using the ‘milk_test’ formula.  The formula ‘=milk_test(“milk”, -2)’ will return the milk for the second most recent milk test.  The documentation for formulas can be found here:  Report Item Formula  This pattern can be repeated for each lactation of each animal.  To be efficient and improve speed, you can utilize logic like don’t request 4th lactation milk tests on youngstock.

This article contains attachments.  See below:

    • Related Articles

    • Best Practices for setting up protocols

      Vaccination Protocols       When setting up vaccination protocols, there are generally 2 flavors.  Vaccines that are always done at the time of another event (preg checked preg, dry check of preg, a certain hoof trim event, etc), and vaccines that ...
    • Grant API Access to Companies

      You must be an "Admin" on the account to add permissions. For more information see:  Requesting Access to a BoviSync Herd To allow API access to your herd you must add the user account for the company who wants access.  To see a complete list of ...
    • Introduction to the BoviSync Website Application

      There are a few methods to navigate BoviSync: The Menu Bar The Navigator Using of your internet browser’s bookmarks Because the program is displayed through a web browser, you can use bookmarks to be able to return to specific reports, cow pages, ...
    • Accessing BoviSync WebApp

      BoviSync is supported in all modern web browsers such as; Google Chrome, Microsoft Edge, FireFox, and Safari. However, BoviSync works the best using Google Chrome or Microsoft Edge and is the preferred browser. Click the pictures below to access the ...
    • BoviSync Drug Inventory

      How to use the BoviSync Drug Inventory Accessing the Drug Inventory  1. Click on "Enter"  2. Click on "Drug Inventory" Alternatively, you can also navigate here:  https://bovisync.farm/inventory/drug/ Note:  This is a paid interface add-on, if you do ...