Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.

Be sure to set your public apikey and also the value for animalOrgID.

It's possible to dynamically update data and information on websites using publicly accessible data via the HTTP API.


To do this via the Website service, you'll need both a Custom Code Snippet, and a web page with some HTML included.

Custom Code Snippet

Create a Custom Code Snippet and include the following JavaScript code:

Code Block
<script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>

var thing = {"apikey":"****","objectType":"animals","objectAction":"publicSearch","search":{"calcFoundRows":"Yes","resultStart":0,"resultLimit":0,"fields":["animalName"],"filters":[{"fieldName":"animalStatus","operation":"equals","criteria":"Adopted"},{"fieldName":"animalOrgID","operation":"equals","criteria":"****"}]}};
var encoded = $.toJSON(thing)

  url: "" + encoded,  
  dataType: "jsonp",
  success: function(data) {
        if (data.foundRows) document.getElementById('adoptedPetsCount').innerHTML = data.foundRows;
  error: function(xhr, status, error) {

Be sure to enter replace the asterisks in the example above with your public API Key for the apikey value and your account number for the animalOrgID value.

Add content to the web page

Edit the web page or content area where you would like the dynamic data to appear.  You'll need to do two things: