API Information

The RentTrack API is designed to be flexible, yet easy to use for both scripters and end-users. It is used for communicating and interfacing with other objects around the rental box. It can pass information to them such as when a box becomes rented, and when it expires. For instance, it can pass information to a door which will then give the tenant access to open and close the door, etc.

There are 5 things that you can send across the API channel:

  • Rental Status (*STATUS*): Did the box become rented, expire, or was time adjusted? Replaced with “Rented”, “Expired”, and “Adjusted” after processing.
  • Rental Start (*RENTALSTART*): Timestamp of when the rental started.
  • Rental End (*RENTALEND*): Timestamp of when the rental ends.
  • Tenant Name (*NAME*): Name of the current tenant.
  • Tenant Key (*KEY*): Key of the current tenant.

NOTE: A timestamp is a Unix timestamp – technically speaking it is the number of seconds elapsed since midnight UTC of January 1, 1970, not counting leap seconds.

This information is passed through the API channel by specifying API commands at the bottom of the _config notecard. So, for example, if you create a custom API command using the *NAME* placeholder, this will be processed by the API script and replaced with the tenant name. You can also give EACH API command its own channel by putting the channel in curly braces – IE {xx} – at the end of the command.

“The tenant name is *NAME*” becomes “The tenant name is Stylez Gomez”

You can use this to alter and create your own custom API commands for use with RentTrack plugins, or possibly plugins for other rental systems! You can also have more than one API command sent every time the API is triggered! This allows you to control multiple objects from the same rental box. For instance, you could have 2 API commands – one which enables a door, and one which adds the tenant name to a board listing all tenants in that area.

Please see the instructions of any plug-ins for the API command that needs to be added to your RentTrack _config notecard.