.. _serviceapi: Service API =========== ASM includes a service API that you can call from other software via HTTP. To call the API you construct a URL to the service controller. The service controller is /service, so if you are accessing a local ASM from your local machine, the URL will start http://localhost:5000/service. If you are using sheltermanager.com, the URL will start https://service.sheltermanager.com/asmservice. If you are using sheltermanager.com, or have enabled the option CACHE_SERVICE_RESPONSES in your sitedefs.py, please be aware that some service call responses are cached for performance. The cache time is indicated with the call below. While the examples here show passing the parameters with HTTP GET requests, you can POST the parameters too if you prefer. The service requires the following parameters: * account: If this is a sheltermanager.com service call, the user's account number. Can be omitted for other installations. * username: A valid ASM user. * password: A valid ASM password. From a security standpoint, it's better to create at least one ASM user dedicated to calling the service to assist with audit trails and to lock it down so an attacker with the URL cannot change your data or view anything you don't want them to. * method: A service method to call * animalid / title: An animal ID or title depending on the service method called. Animal Datasets --------------- Many of the json and xml service calls return a dataset of animals, a sample animal JSON result looks like this:: [ { "ACCEPTANCENUMBER": "", "ACTIVEMOVEMENTADOPTIONNUMBER": null, "ACTIVEMOVEMENTCOMMENTS": null, "ACTIVEMOVEMENTCREATEDBY": null, "ACTIVEMOVEMENTCREATEDBYNAME": null, "ACTIVEMOVEMENTCREATEDDATE": null, "ACTIVEMOVEMENTDATE": null, "ACTIVEMOVEMENTDONATION": null, "ACTIVEMOVEMENTID": 0, "ACTIVEMOVEMENTINSURANCENUMBER": null, "ACTIVEMOVEMENTLASTCHANGEDBY": null, "ACTIVEMOVEMENTLASTCHANGEDDATE": null, "ACTIVEMOVEMENTREASONFORRETURN": null, "ACTIVEMOVEMENTRESERVATIONDATE": null, "ACTIVEMOVEMENTRETURN": null, "ACTIVEMOVEMENTRETURNDATE": null, "ACTIVEMOVEMENTTRIALENDDATE": null, "ACTIVEMOVEMENTTYPE": null, "ACTIVEMOVEMENTTYPENAME": null, "ADDITIONALFLAGS": "|", "ADOPTAPETCOLOUR": "Black", "ADOPTIONCOORDINATOREMAILADDRESS": null, "ADOPTIONCOORDINATORHOMETELEPHONE": null, "ADOPTIONCOORDINATORID": 0, "ADOPTIONCOORDINATORMOBILETELEPHONE": null, "ADOPTIONCOORDINATORNAME": null, "ADOPTIONCOORDINATORWORKTELEPHONE": null, "AGEGROUP": "Senior", "AGEGROUPACTIVEMOVEMENT": "Senior", "ANIMALAGE": "12 years 7 months.", "ANIMALCOMMENTS": "Cat that needs a longer bio than 20 chars.", "ANIMALCONTROLINCIDENTDATE": null, "ANIMALCONTROLINCIDENTID": null, "ANIMALCONTROLINCIDENTNAME": null, "ANIMALNAME": "Sarah", "ANIMALTYPEID": 2, "ANIMALTYPENAME": "U (Unwanted Cat)", "ARCHIVED": 0, "ASILOMARINTAKECATEGORY": 0, "ASILOMARISTRANSFEREXTERNAL": 0, "ASILOMAROWNERREQUESTEDEUTHANASIA": 0, "BASECOLOURID": 1, "BASECOLOURNAME": "Black", "BONDEDANIMAL1ARCHIVED": null, "BONDEDANIMAL1CODE": null, "BONDEDANIMAL1NAME": null, "BONDEDANIMAL2ARCHIVED": null, "BONDEDANIMAL2CODE": null, "BONDEDANIMAL2ID": 0, "BONDEDANIMAL2NAME": null, "BONDEDANIMALID": 0, "BREED2ID": 231, "BREEDID": 231, "BREEDNAME": "British Shorthair", "BREEDNAME1": "British Shorthair", "BREEDNAME2": "British Shorthair", "BROUGHTINBYEMAILADDRESS": "", "BROUGHTINBYHOMETELEPHONE": "", "BROUGHTINBYJURISDICTION": "", "BROUGHTINBYMOBILETELEPHONE": "", "BROUGHTINBYOWNERADDRESS": "", "BROUGHTINBYOWNERCOUNTY": "", "BROUGHTINBYOWNERID": "", "BROUGHTINBYOWNERNAME": "", "BROUGHTINBYOWNERPOSTCODE": "", "BROUGHTINBYOWNERTOWN": "", "BROUGHTINBYWORKTELEPHONE": "", "COATTYPE": 4, "COATTYPENAME": "Corded", "CODE": "1D", "COMBITESTDATE": null, "COMBITESTED": 0, "COMBITESTEDNAME": "No", "COMBITESTRESULT": 0, "COMBITESTRESULTNAME": "Unknown", "CREATEDBY": "robin", "CREATEDDATE": "2010-01-18T10:20:50", "CROSSBREED": 0, "CROSSBREEDNAME": "No", "CRUELTYCASE": 0, "CRUELTYCASENAME": "No", "CURRENTOWNERADDRESS": "", "CURRENTOWNERCOUNTRY": "", "CURRENTOWNERCOUNTY": "", "CURRENTOWNEREMAILADDRESS": "", "CURRENTOWNEREXCLUDEEMAIL": "", "CURRENTOWNERFORENAMES": "", "CURRENTOWNERHOMETELEPHONE": "", "CURRENTOWNERID": "", "CURRENTOWNERINITIALS": "", "CURRENTOWNERJURISDICTION": "", "CURRENTOWNERMOBILETELEPHONE": "", "CURRENTOWNERNAME": "", "CURRENTOWNERPOSTCODE": "", "CURRENTOWNERSURNAME": "", "CURRENTOWNERTITLE": "", "CURRENTOWNERTOWN": "", "CURRENTOWNERWORKTELEPHONE": "", "CURRENTVETADDRESS": null, "CURRENTVETCOUNTY": null, "CURRENTVETEMAILADDRESS": null, "CURRENTVETID": 0, "CURRENTVETLICENCENUMBER": null, "CURRENTVETNAME": null, "CURRENTVETPOSTCODE": null, "CURRENTVETTOWN": null, "CURRENTVETWORKTELEPHONE": null, "DAILYBOARDINGCOST": 0, "DATEBROUGHTIN": "2010-01-18T00:00:00", "DATEOFBIRTH": "2008-01-18T00:00:00", "DAYSONSHELTER": 3886, "DECEASEDDATE": null, "DECLAWED": 0, "DECLAWEDNAME": "No", "DIEDOFFSHELTER": 0, "DIEDOFFSHELTERNAME": "No", "DISPLAYLOCATION": "Dog Block::3", "DISPLAYLOCATIONNAME": "Dog Block", "DOCMEDIADATE": "2015-05-11T00:00:00", "DOCMEDIANAME": "198.jpg", "ENTRYREASONID": 7, "ENTRYREASONNAME": "Stray", "ESTIMATEDDOB": 0, "ESTIMATEDDOBNAME": "No", "EXTRAIDS": "", "FEE": 0, "FLVRESULT": 0, "FLVRESULTNAME": "Unknown", "HASACTIVERESERVE": 0, "HASACTIVERESERVENAME": "No", "HASFUTUREADOPTION": 0, "HASPERMANENTFOSTER": 0, "HASSPECIALNEEDS": 0, "HASSPECIALNEEDSNAME": "No", "HASTRIALADOPTION": 0, "HASTRIALADOPTIONNAME": "No", "HEALTHPROBLEMS": "", "HEARTWORMTESTDATE": null, "HEARTWORMTESTED": 0, "HEARTWORMTESTEDNAME": "No", "HEARTWORMTESTRESULT": 0, "HEARTWORMTESTRESULTNAME": "Unknown", "HIDDENANIMALDETAILS": "", "HOLDUNTILDATE": null, "ID": 174, "IDENTICHIP2DATE": null, "IDENTICHIP2NUMBER": "", "IDENTICHIPDATE": null, "IDENTICHIPNUMBER": "", "IDENTICHIPPED": 0, "IDENTICHIPPEDNAME": "No", "ISCOURTESY": 0, "ISDOA": 0, "ISDOANAME": "No", "ISGOODWITHCATS": 0, "ISGOODWITHCATSNAME": "Yes", "ISGOODWITHCHILDREN": 2, "ISGOODWITHCHILDRENNAME": "Unknown", "ISGOODWITHDOGS": 2, "ISGOODWITHDOGSNAME": "Unknown", "ISHOLD": 0, "ISHOUSETRAINED": 2, "ISHOUSETRAINEDNAME": "Unknown", "ISNOTAVAILABLEFORADOPTION": 0, "ISNOTAVAILABLEFORADOPTIONNAME": "No", "ISNOTFORREGISTRATION": 0, "ISNOTFORREGISTRATIONNAME": "No", "ISPICKUP": 0, "ISPICKUPNAME": "No", "ISQUARANTINE": 0, "ISTRANSFER": 0, "ISTRANSFERNAME": "No", "JURISDICTIONID": 0, "JURISDICTIONNAME": null, "LASTCHANGEDBY": "robin", "LASTCHANGEDDATE": "2018-08-27T10:25:07.534155", "LOOKUPDEFAULT": "Item 3", "MARKINGS": "", "MOSTRECENTENTRYDATE": "2010-01-18T00:00:00", "NEUTERED": 1, "NEUTEREDBYVETID": 0, "NEUTEREDDATE": "2009-01-18T00:00:00", "NEUTEREDNAME": "Yes", "NEUTERINGVETADDRESS": null, "NEUTERINGVETCOUNTY": null, "NEUTERINGVETEMAILADDRESS": null, "NEUTERINGVETLICENCENUMBER": null, "NEUTERINGVETNAME": null, "NEUTERINGVETPOSTCODE": null, "NEUTERINGVETTOWN": null, "NEUTERINGVETWORKTELEPHONE": null, "NONSHELTERANIMAL": 0, "NONSHELTERANIMALNAME": "No", "ORIGINALOWNERADDRESS": "", "ORIGINALOWNERCOUNTRY": "", "ORIGINALOWNERCOUNTY": "", "ORIGINALOWNEREMAILADDRESS": "", "ORIGINALOWNERFORENAMES": "", "ORIGINALOWNERHOMETELEPHONE": "", "ORIGINALOWNERID": "", "ORIGINALOWNERINITIALS": "", "ORIGINALOWNERJURISDICTION": "", "ORIGINALOWNERMOBILETELEPHONE": "", "ORIGINALOWNERNAME": "", "ORIGINALOWNERPOSTCODE": "", "ORIGINALOWNERSURNAME": "", "ORIGINALOWNERTITLE": "", "ORIGINALOWNERTOWN": "", "ORIGINALOWNERWORKTELEPHONE": "", "OWNERID": 0, "OWNERNAME": null, "OWNERSVETADDRESS": null, "OWNERSVETCOUNTY": null, "OWNERSVETEMAILADDRESS": null, "OWNERSVETID": 0, "OWNERSVETLICENCENUMBER": null, "OWNERSVETNAME": null, "OWNERSVETPOSTCODE": null, "OWNERSVETTOWN": null, "OWNERSVETWORKTELEPHONE": null, "PETFINDERBREED": "British Shorthair", "PETFINDERBREED2": "British Shorthair", "PETFINDERSPECIES": "Cat", "PICKUPADDRESS": "", "PICKUPLOCATIONID": 0, "PICKUPLOCATIONNAME": null, "PTSREASON": "", "PTSREASONID": 8, "PTSREASONNAME": "Biting", "PUTTOSLEEP": 0, "PUTTOSLEEPNAME": "No", "RABIESTAG": "", "REASONFORENTRY": "", "REASONNO": "", "RECENTLYCHANGEDIMAGES": 0, "RECORDVERSION": 102507, "RESERVATIONDATE": null, "RESERVATIONSTATUSNAME": null, "RESERVEDOWNERADDRESS": "", "RESERVEDOWNERCOUNTY": "", "RESERVEDOWNEREMAILADDRESS": "", "RESERVEDOWNERHOMETELEPHONE": "", "RESERVEDOWNERID": "", "RESERVEDOWNERJURISDICTION": "", "RESERVEDOWNERMOBILETELEPHONE": "", "RESERVEDOWNERNAME": "", "RESERVEDOWNERPOSTCODE": "", "RESERVEDOWNERTOWN": "", "RESERVEDOWNERWORKTELEPHONE": "", "SEX": 0, "SEXNAME": "Female", "SHELTERCODE": "D2010001", "SHELTERLOCATION": 1, "SHELTERLOCATIONDESCRIPTION": "", "SHELTERLOCATIONNAME": "Dog Block", "SHELTERLOCATIONUNIT": "3", "SHORTCODE": "1D", "SITEID": 1, "SITENAME": "main", "SIZE": 1, "SIZENAME": "Large", "SMARTTAG": 0, "SMARTTAGDATE": null, "SMARTTAGNUMBER": "", "SMARTTAGSENTDATE": null, "SMARTTAGTYPE": 0, "SPECIESID": 2, "SPECIESNAME": "Cat", "TATTOO": 0, "TATTOODATE": null, "TATTOONAME": "No", "TATTOONUMBER": "", "TIMEONSHELTER": "10 years 7 months.", "TOTALDAYSONSHELTER": 3162, "TOTALTIMEONSHELTER": "8 years 7 months.", "UNIQUECODEID": 0, "WEBSITEIMAGECOUNT": 2, "WEBSITEMEDIADATE": "2013-05-12T09:13:21", "WEBSITEMEDIAID": 118, "WEBSITEMEDIANAME": "118.jpg", "WEBSITEMEDIANOTES": "Cat that needs a longer bio than 20 chars.", "WEBSITEVIDEONOTES": "", "WEBSITEVIDEOURL": "https://www.youtube.com/watch?v=dQw4w9WgXcQ", "WEIGHT": 10.0, "YEARCODEID": 1 } ] animal_image ------------ .. rubric:: Cache time: 1 hour Returns an animal's preferred image. Send the id of the animal:: http://localhost:5000/service?method=animal_image&animalid=520&seq=1 An optional "seq" parameter can be included to return the animal's other available images. seq=1 returns the preferred image (and will be assumed if that parameter is omitted), seq=2 returns the second available image, etc. seq is a 1-based count and can be used with the "WebsiteImageCount" property included in animal records (which contains the number of images an animal has) to programatically grab all the images for a particular animal. animal_thumbnail ---------------- .. rubric:: Cache time: 1 day Returns an animal's preferred image as a thumbnail. Send the id of the animal:: http://localhost:5000/service?method=animal_thumbnail&animalid=520 The thumbnail will be sized to whatever the main application is using (typically 150 pixels along the longest side). animal_view ----------- .. rubric:: Cache time: 2 minutes Returns a webpage with information for one adoptable animal, constructed from the animalview HTML publishing template (editable at :menuselection:`Publishing -> Edit HTML publishing templates`). Pass the id of the animal:: http://localhost:5000/service?method=animal_view&animalid=520 When you use :menuselection:`Share --> Link to this animal` on an animal's record, it is this service call that the system redirects you to. If the animal is no longer adoptable, an error page will be displayed. If you prefer, you can create an HTML publishing template called "animalviewnotadoptable" that will display instead for animals that can no longer be adopted. animal_view_adoptable_js ------------------------ .. rubric:: Cache time: 10 minutes Returns a javascript file that when executed injects thumbnails of all adoptable animals into the page with links to the animal_view service call. It is most useful as the src attribute for a CSS and Styles ^^^^^^^^^^^^^^ The adoptable_js output is unstyled - just a thumbnail with a name/link below and two lines of brief text containing some basic information about the animal. You can style this information by adding CSS to your stylesheets for the following classes: * asm3-filters : The div surrounding the SELECT dropdown filters * asm3-adoptable-list: The div surrounding all the animal thumbnails * asm3-adoptable-item : The div surrounding each animal thumbnail * asm3-adoptable-link : The a tag enclosing the thumbnail and animal name * asm3-adoptable-thumbnail : The thumbnail img tag * asm3-adoptable-name : The animal's name * asm3-adoptable-reserved : The div surrounding the image if the animal is reserved * asm3-adoptable-tagline : The brief animal information and the following elements by their id attribute: * asm3-adoptable-iframe-overlay: The div surrounding the popup iframe (if used) * asm3-adoptable-iframe-close: The close link at the top right of the popup * asm3-adoptable-iframe: The popup iframe itself Eg: To add rounded corners to the thumbnails and show the animal's name in bold, add this to your CSS:: .asm3-adoptable-name { font-weight: bold; } .asm3-adoptable-thumbnail { border-radius: 8px; } To increase the size of the close link, add this:: #asm3-adoptable-iframe-close { font-size: 200%; } Much more advanced and sophisticated styling can be done from these classes and selectors. For example, to float a reserved banner over the top right corner of animals with reservations, try this:: .asm3-adoptable-reserved { position: relative; color: #fff; display: inline-block; padding: 5px; overflow: hidden; font-family: Arial, sans-serif; font-size: 8pt; font-weight: bold; } .asm3-adoptable-reserved span:before { content: "\00a0\00a0\00a0\00a0\00a0RESERVED"; } .asm3-adoptable-reserved span { position: absolute; display: inline-block; right: -25px; box-shadow: 0px 0px 10px rgba(0,0,0,0.2), inset 0px 5px 30px rgba(255,255,255,0.2); text-align: center; top: 6px; background: #ff0000; width: 100px; padding: 3px 10px; opacity: 0.9; transform: rotate(45deg); } Translations ^^^^^^^^^^^^ It's possible to translate any of the text output by the adoptable list on the fly. By default, it only uses text from your database values so they will match the language of your database. You can add on-the-fly translation by adding a script tag with a dictionary called asm3_adoptable_translations above the script that makes the service call. Eg to translate some English species to French and to change the default (any species) to all as well as the CLOSE link text::
Filters ^^^^^^^ You can also add a filter callback, which allows you to implement your own filter based on other elements in the page. The callback receives the complete animal record and must return true if the record is to be included in the list of thumbnails. For example, to only output animals with a species of dog, you could use this callback::
Additional arguments are also passed to asm3_adoptable_filter containing the index of the current element and complete list. Definition: asm3_adoptable_filter(item, index, arr) Which dropdowns appear depends on the asm3_adoptable_filters string. To use them all, include the following asm3_adoptable_filters line. The order in which they appear in the filters line is also used to output that piece of information below the animal's name in the list::
Sort ^^^^ You can choose the sort order by setting an asm3_adoptable_sort variable. The default is ANIMALNAME, but another useful value is -DAYSONSHELTER to output animals based on how long they've been on shelter with the longest first. Preceding the sort field with a minus symbol - will sort in descending order. You can also use precede the sort field with an at symbol @ to do a numeric sort rather than a string/alphanumeric sort::
A special sort keyword of SHUFFLE can also be used, if instead of sorting you'd like the adoptable animals to be output in a random order::
Extra Content ^^^^^^^^^^^^^ It's also possible to add an extra content callback, which adoptable_js calls for every animal it outputs. For example, to add the animal's bio below the thumbnail and basic info::
You could set .asm3-adoptable-tagline to display: none and then use an extra content callback to output and format any data from the animal's record in the way you want and override the default behaviour. Limit ^^^^^ You can limit the number of animals rendered by the adoptable_js output. This is useful if you want to only show a limited number of animals - eg: If this call is on the home page of your website and you'd like to show some featured animals. For example, this will limit output to the first 3 animals in the set. Combined with the -DAYSONSHELTER sort, it will show the 3 animals who have been on shelter the longest::
Popup iFrame ^^^^^^^^^^^^ By default, clicking on an animal thumbnail or link will load the target animalview page in a new browser tab. However, the system can also load the page in a floating iframe so that viewing adoptable animals does not leave your site. You can enable this behaviour by setting asm3_adoptable_iframe = true in your script. Eg::
Some positioning styles for the iframe have to be supplied programatically and cannot be set by CSS (everything else can be), but there are a couple of javascript variables you can set for them instead. Eg: To fix the iframe height at 2000 pixels and use a gray background instead of the default of white::
By default, the iframe will use absolute positioning. If your page has multiple screens of vertical height, this will cause it to scroll back to the top when viewing an animal. Setting asm3_adoptable_iframe_fixed will use fixed positioning instead, which keeps the position of the parent page when viewing animals, but this has been found to be less compatible with some browsers and iframes. animal_view_adoptable_html -------------------------- .. rubric:: Cache time: 2 minutes Returns a complete HTML document that references animal_view_adoptable_js to show a list of adoptable animals. It looks for an HTML template called "animalviewadoptables" and falls back to a basic internal template if it does not exist. http://localhost:5000/service?method=&animal_view_adoptable_html csv_mail and csv_report ----------------------- .. rubric:: Cache time: 10 minutes Returns a CSV file containing a mail merge or report. Pass the name of the mail merge/report in the title attribute and if the merge requires any parameters, you can pass those too just like with html_report:: http://localhost:5000/service?method=csv_report&username=user&password=letmein&title=Detailed+Shelter+Inventory extra_image ----------- .. rubric:: Cache time: 1 day Returns an extra image (see :menuselection:`Settings --> Reports --> Extra Images`). Pass the name of the image in the title parameter:: http://localhost:5000/service?method=extra_image&title=splash.jpg html_adoptable_animals ---------------------- .. rubric:: Cache time: 30 minutes Returns a complete HTML document containing an HTML page of adoptable animals. You can pass an HTML template name in an optional "template" parameter (leaving it off will cause animalview to be used). It is also possible extra parameters: * speciesid=X - only output animals of that species. In the default dataset, speciesid=1 is Dogs and speciesid=2 is cats. * animaltypeid=X - only output animals of that type. Run this query at the SQL interface to find out the ID numbers: SELECT * FROM animaltype * locationid=X - only output animals in this location. Run this query at the SQL interface to find out the ID numbers: SELECT * FROM internallocation The rules governing which animals are adoptable are those set under :menuselection:`Publishing --> Set Publishing Options --> Animal Selection`. You can view the set at :menuselection:`Publishing --> View Animals Matching Publishing Options` http://localhost:5000/service?method=html_adoptable_animals&template=littlebox&speciesid=1 http://localhost:5000/service?method=html_adoptable_animals html_adopted_animals ---------------------- .. rubric:: Cache time: 30 minutes Returns a complete HTML document containing an HTML page of recently adopted animals. You can pass an HTML template name in an optional "template" parameter (leaving it off will cause animalview to be used). It is also possible to pass speciesid=X or animaltypeid=X parameters to only output animals of that species and type. In the default dataset, speciesid=1 is Dogs and speciesid=2 is cats. You can also pass a "days" parameter to indicate how far you would like to go back. If you do not set it, the default is animals adopted in the last 30 days. http://localhost:5000/service?method=html_adopted_animals&template=littlebox&speciesid=1&days=60 http://localhost:5000/service?method=html_adopted_animals html_deceased_animals ---------------------- .. rubric:: Cache time: 30 minutes Returns a complete HTML document containing an HTML page of recently deceased animals. You can pass an HTML template name in an optional "template" parameter (leaving it off will cause animalview to be used). It is also possible to pass speciesid=X or animaltypeid=X parameters to only output animals of that species and type. In the default dataset, speciesid=1 is Dogs and speciesid=2 is cats. You can also pass a "days" parameter to indicate how far you would like to go back. If you do not set it, the default is animals deceased in the last 30 days. http://localhost:5000/service?method=html_deceased_animals&template=littlebox&speciesid=1&days=60 http://localhost:5000/service?method=html_deceased_animals html_flagged_animals ---------------------- .. rubric:: Cache time: 30 minutes Returns a complete HTML document containing an HTML page of shelter animals that have a particular flag. You can pass an HTML template name in an optional "template" parameter (leaving it off will cause animalview to be used). It is also possible to pass speciesid=X or animaltypeid=X parameters to only output animals of that species and type. In the default dataset, speciesid=1 is Dogs and speciesid=2 is cats. A "flag" parameter must be passed to specify the flag you want the returned animals to have. If no flag is set, an error is returned. An "all=1" parameter can optionally be passed if you'd like all animals to be included, not just shelter animals. http://localhost:5000/service?method=html_flagged_animals&template=littlebox&speciesid=1&all=1&flag=Needs+Foster http://localhost:5000/service?method=html_flagged_animals&flag=At+Risk html_held_animals ---------------------- .. rubric:: Cache time: 30 minutes Returns a complete HTML document containing an HTML page of current held animals. You can pass an HTML template name in an optional "template" parameter (leaving it off will cause animalview to be used). It is also possible to pass speciesid=X or animaltypeid=X parameters to only output animals of that species and type. In the default dataset, speciesid=1 is Dogs and speciesid=2 is cats. http://localhost:5000/service?method=html_held_animals&template=littlebox&speciesid=1 http://localhost:5000/service?method=html_held_animals html_report ----------- .. rubric:: Cache time: 10 minutes Returns an HTML document containing a report. Pass the name of the report in the title attribute. If the report requires any parameters, you can pass those too. VAR parameters are just their name, ASK parameters are ASKn where n is the order within the SQL. If you run the report within the ASM frontend you will see the parameters it requires in the address bar:: http://localhost:5000/service?method=html_report&username=user&password=letmein&title=Detailed+Shelter+Inventory json_adoptable_animal and xml_adoptable_animal ---------------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing a single animal record from the list of animals available for adoption. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_adoptable_animal&animalid=123&username=user&password=letmein .. note:: If the animal with animalid is not adoptable, an empty result set will be returned. json_adoptable_animals and xml_adoptable_animals ------------------------------------------------ .. rubric:: Cache time: 10 minutes Returns a dataset containing all animals available for adoption. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_adoptable_animals&username=user&password=letmein json_lost_animals, xml_lost_animals, json_found_animals, xml_found_animals -------------------------------------------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing all lost or found animals reported in the last 90 days that are still active. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_found_animals&username=user&password=letmein json_held_animals and xml_held_animals -------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing all animals currently held. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_adoptable_animals&username=user&password=letmein json_recent_adoptions and xml_recent_adoptions ---------------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing all recently adopted animals with their new owner information. The method name determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_recent_adoptions&username=user&password=letmein json_recent_changes and xml_recent_changes -------------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing all animals who have been modified in the last month. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_recent_changes&username=user&password=letmein json_shelter_animals and xml_shelter_animals -------------------------------------------- .. rubric:: Cache time: 1 hour Returns a dataset containing all animals currently in the care of the shelter. The method determines whether the format returned is JSON or XML:: http://localhost:5000/service?method=xml_shelter_animals&username=user&password=letmein By default, any personal or sensitive data (such as names and contact information of fosterers and surrenders) will be stripped from the results. If you wish them to be included, pass an extra sensitive=1 parameter:: http://localhost:5000/service?method=xml_shelter_animals&username=user&password=letmein&sensitive=1 rss_timeline ------------ .. rubric:: Cache time: 1 hour Returns an RSS feed of the timeline for use with feed aggregators:: http://localhost:5000/service?method=rss_timeline&username=user&password=letmein