Best Practices


    Follow best practice to make sure your application does not fail when the Livestock Developer Hub makes changes to the production environment.

    Coupling to Livestock

    Avoid tightly coupling your application to the Livestock service. The systems will be dependent on one another so a change to one will affect both.

    Use loose coupling - this reduces dependencies so that non-breaking changes will not affect your application.

    Error Handling

    Livestock Information service puts huge effort in ensuring that our API are efficient and have no issues however you should never assume that an API is going to be working properly, or even be available when you need it. Ensure that you have proper error handling in your client code, able to deal with various error codes that the Livestock API can return. To check the exact list of error codes that an API can return, go to the API documentation page.

    Validation & Testing

    Ensure that you have proper validation & quality assurance processes in place when consuming Livestock APIs.

    We recommended

    1. that you build your application against the Livestock Ext/Sandbox API and then move your application code into Test
    2. QA and Pre-Prod environments all the while consuming the livestock sandbox API
    3. Once you are satisfied with the quality of your code and integration, raise a request with Livestock to get access to production API endpoints and consume these in your production deployment only. Livestock Production endpoints should never be used in your development and test environments.

    HTTPS certificates

    Use a global root CA keystore and do not pin Livestock specific certificates.

    The Livestock Developer Hub’s HTTPS certificates can change - this includes the leaf, intermediary and root certificates.

    If you import any Livestock specific certificates into your keystore or load balancer, your application may fail to connect when changes are made to the certificate.

    IP addresses

    IP addresses can change because we cannot supply static addresses.

    To access our API platform and token generation with your application:

    • you might need to configure your network
    • any end users might need to configure their own network

    You need to configure your network access in your proxy, not your firewall.

    Cross-origin resource sharing (CORS)

    The Livestock Developer Hub does not support CORS (opens in a new tab). It is not possible to call our APIs from client-side code within a web browser, for example using Ajax.

    Changes will affect your application

    A breaking change is a change to the Livestock API platform that requires you to make changes to your application so it continues to work.

    Breaking changes can be:

    • API specific
    • Platform wide (for example TLS version and cipher suite changes)

    The breaking change will be published to the Sandbox/Ext environment initially and we recommend you run your automated test pack against the Sandbox/Ext environment on a regular basis.

    Minimum TLS version

    DeveloperHub only supports TLS1.2. More information can found on the Microsoft site - How to enable TLS 1.2 (opens in a new tab).