Jetstream API
General
API Basics
25min
overview the jetstream api enables you, a developer, to configure and query your https //www tersosolutions com/search all sensors/ and jetstream application – allowing you to quickly enhance your business applications with rfid inventory tracking and management capabilities navigating the api documentation the page tree on the left helps you quickly jump between different sections and pages you can quickly flip between jetstream api versions using the version selector in the page tree main provides the documentation for v3, and you can use the selector to view the documentation for jetstream v2 the table of contents on the right helps you quickly jump between different sections within the current page the search bar in the top right can be used to search on any content, on any page, for any version of the api the api basics page contains everything you need to know about how to get requests to and responses from jetstream, along with reference information like version changes and a glossary the openapi documentation for jetstream docid\ ktbeqckrrzxto40m5bqhm page contains the openapi documentation for jetstream, including instructions on how to use this documentation and the latest json for the api the device types docid\ wuwgpfex3jryi7wkewcll section tells you more about the various types of terso rfid devices that can be managed via jetstream, including their commands, configuration parameters, logentryevents, and sensors the api endpoints docid\ f9jcpbjtogu1hggdqjr0b section contains detailed documentation of the various jetstream api command and configuration endpoints, including descriptions, parameters, examples, and version changes the event types docid\ idzrd9kaz2ommxnq6gy section contains descriptions, parameters, examples, and version changes for all events jetstream may return in a get events call you can quickly flip between jetstream api versions using the version selector at the top of this user guide jetstream v3 is the current version, and you can use the selector to view the documentation for jetstream v2 exploring jetstream with postman postman is a powerful tool that allows easy testing and experimenting of apis to start using jetstream in postman, first download https //www getpostman com/downloads/ and install postman here is a guide on how to create a postman collection using the swagger json https //www c sharpcorner com/article/import swagger apis into postman collection/ https //www c sharpcorner com/article/import swagger apis into postman collection/ see the openapi documentation for jetstream docid\ ktbeqckrrzxto40m5bqhm page for a link to the json tools a net sdk and service base are available on github https //github com/tersosolutions additional resources release notes docid\ i w4bqdok8 xzgudzp4we jetstream workflow guides docid\ dvhn6586 zgq5iddgn6a0 how it works jetstream facilitates communication between your remotely deployed terso rfid device types docid\ wuwgpfex3jryi7wkewcll and your application that consumes jetstream messages between your jetstream application and your application that consumes jetstream messages let’s take a look at each communication path in more detail communication with your terso rfid device a remotely deployed terso rfid device initiates communications on its own as well as responds to communications from api requests jetstream will, then, publish the event to the events queue of your jetstream application your application can, then, retrieve the queued events, via a get events docid yaqw97ir03lgkhnui2mb api request how your application uses the events is up to the business logic you’ve coded in for example, the information extracted from a heartbeatevent event could be used to update when a device last communicated and, thus, could serve as an indication that the device has internet connectivity this information would be useful on a devices dashboard your application can communicate with a terso rfid device via command api requests since jetstream supports many different terso rfid devices, each with its own unique capabilities, device definitions are used to define the commands and configuration values each device supports in jetstream for example, to query for a device’s current network configuration, a get a device's configuration parameters docid 94vzb6djztjxfyzb78uj command api request can be made when a command request is made, jetstream determines if the device is online if the device is online, the command is executed immediately is offline, the command is queued in jetstream for the device to pick up and execute the next time it establishes communications or polls for queueable commands once a command is executed, if the command is synchronous, results are returned immediately and can be viewed in the response body if there is no issue executing the command, the output parameter list will be populated with data, if applicable to the command is an issue executing the command, exceptions will appear in the exception list is not synchronous, results are published and can be viewed in a commandcompletionevent docid\ t 7slqwzzeabu593fnbwt event, via get events docid yaqw97ir03lgkhnui2mb the commandcompletionevent event is published to the events queue of your jetstream application after the command executes if there is no issue executing the command, the output parameter list will be populated with data, if applicable to the command is an issue executing the command, exceptions will appear in the exception list in the end, your application will work with a combination of command responses and commandcompletionevent docid\ t 7slqwzzeabu593fnbwt to complete communications with a terso rfid device communication with your jetstream application whereas command api requests are meant to communicate with your terso rfid devices, configuration api requests are meant to communicate with your jetstream application configuration api requests allow you to manage and maintain the resources (e g , devices, device definitions, policies, events) pertaining to your jetstream application within your jetstream application, you can create a device docid 5aqyegsadygl0ggoej2z9 , create a policy docid\ wswho jxi8iu09ehrtp2i , add a policy to a device docid\ u yihqpcnlvud3uag439e , get all devices docid\ zfynxz 5usnfgfgnx24i2 , and more get events docid yaqw97ir03lgkhnui2mb , which has already been mentioned above, is also a configuration api request when making a configuration api request, results are returned immediately and can be viewed in the response body request base url the base url for this version of the jetstream api is https //api jetstreamrfid com/2 note the current version number in the url, as well as the new domain name all requests to the jetstream api must be made over https with tls 1 2 or higher http requests and https requests using tls 1 1 or earlier will not work authentication all requests to the jetstream api require authentication via a user access key in the request header, set a 'accesskey' key with your user access key as the value a user access key is provided during user account sign up and is associated to a jetstream application a user access key is unique to a user and should be securely stored data format the jetstream api accepts and sends data as json for endpoints that send json data, define the header request’s ‘content type’ key with a value of ‘application/json’ http verbs the below http verbs are used by the jetstream api verb description post create a new resource get read/retrieve a resource put update/replace a resource delete delete a resource patch delete a resource only delete events docid 1z8wlwmzoguy dpo9sqgk supports this verb response the jetstream api returns data as json the below http status codes are used by the jetstream api status code description 200 ok successful get, put, and post requests pertaining to reading/retrieving resources updating/replacing resources configuring resources (e g , creating, modifying, or deleting device credentials, aliases) commanding resources (e g , restart a device, lock a device, unlock a device) 201 created successful post requests pertaining to creating new resources configuring resources (e g , adding a policy to a device) 204 no content successful delete requests pertaining to deleting resources configuring resources (e g , removing a policy from a device) note no message body is returned 400 bad request pertains to requests with errors (e g , malformed syntax, missing required parameters, invalid parameter values) requests failing due to conditions not being met requests failing due to an invalid uri note see the error message(s) given in the response message body for more details 401 unauthorized pertains to requests failing due to a missing or invalid access key 404 not found pertains to requests failing due to the requested resource not existing or not being found requests failing due to the resource(s) relating to the requested resource not existing or not being found – see the error message(s) given in the response message body for more details requests failing due to an invalid uri 500 internal server error something went wrong on our end – we do our best to avoid these situations try your request again later if this error persists, please contact us https //www tersosolutions com/contact us/ search & sort searching and sorting allow you to slim down and arrange the returned data, ensuring you only focus on the data you need search and sort large result sets via passing parameters in the url by including a query string the details for each query type are outlined below search search can be used on its own, separate from sort, as follows in this example, we will be using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application containing the name "terso" here’s how to do so https //api jetstreamrfid com/2/devices?name=terso notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "name" parameter is a property of the device resource not all properties of a resource are searchable see the parameters table for each endpoint to determine which properties are searchable the returned search results will contain devices with a name containing and equal to "terso" what if you wanted to find all devices in your jetstream application containing the names "terso" and "solutions"? it’s possible and here’s how to do so https //api jetstreamrfid com/2/devices?name=terso,solutions notes the "," character is used to separate multiple values there should be no space following the comma the returned search results will contain devices with a name containing and equal to "terso" and devices with a name containing and equal to "solutions" search on multiple properties in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application containing the name "terso", the serial number "1234", and the region "us" here’s how to do so https //api jetstreamrfid com/2/devices?name=terso\&serialnumber=1234\®ion=us notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "name", "serial number", and "region" parameters are all properties of the device resource not all properties of a resource are searchable see the parameters table for each endpoint to determine which properties are searchable the "&" character is used to separate multiple parameters there should be no spaces preceding or following the ampersand the returned search results will contain devices with a name containing and equal to "terso" and devices with a serial number containing and equal to "1234" and devices with a region containing and equal to "us" what if you wanted to find all devices in your jetstream application containing the names "terso" and "solutions", the serial numbers "1234" and "4321", and the regions "us" and "ap"? it’s possible and here’s how to do so https //api jetstreamrfid com/2/devices?name=terso,solutions\&serialnumber=1234,4321\®ion=us,ap notes the "," character is used to separate multiple values there should be no space following the comma the returned search results will contain devices with a name containing and equal to "terso" and devices with a name containing and equal to "solutions" and devices with a serial number containing and equal to "1234" and devices with a serial number containing and equal to "4321" and devices with a region containing and equal to "us" and devices with a region containing and equal to "ap" in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application not containing the name "terso" here’s how to do so https //api jetstreamrfid com/2/devices?name=!terso notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "name" parameter is a property of the device resource not all properties of a resource are searchable see the parameters table for each endpoint to determine which properties are searchable the "!" character is used to exclude results it must precede the value to be excluded the returned search results will contain devices with names that do not contain or are not equal to "terso" what if you wanted to find all devices in your jetstream application not containing the names "terso" and "solutions"? it’s possible and here’s how to do so https //api jetstreamrfid com/2/devices?name=!terso,solutions notes the "!" character is used to exclude results it must precede the first value to be excluded, and you only need one "!" before all excluded values the "," character is used to separate multiple values there should be no space following the comma the returned search results will contain devices with a name neither containing nor equal to "terso" and devices with a name neither containing nor equal to "solutions" in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application that do not contain the name "terso", the serial number "1234", and the region "us" here’s how to do so https //api jetstreamrfid com/2/devices?name=!terso\&serialnumber=!1234\®ion=!us notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "name", "serial number", and "region" parameters are all properties of the device resource not all properties of a resource are searchable see the parameters table for each endpoint to determine which properties are searchable the "!" character is used to exclude results it must precede the first value to be excluded, and you only need one "!" before all excluded values the "&" character is used to separate multiple parameters there should be no spaces preceding or following the ampersand the returned search results will contain devices with a name neither containing nor equal to "terso" and devices with a serial number neither containing nor equal to "1234" and devices with a region neither containing nor equal to "us" what if you wanted to find all devices in your jetstream application that do not contain the names "terso" and "solutions", the serial numbers "1234" and "4321", and the regions "us" and "ap"? it’s possible and here’s how to do so https //api jetstreamrfid com/2/devices?name=!terso,solutions\&serialnumber=!1234,4321\®ion=!us,ap notes the "!" character is used to exclude results it must precede the first value to be excluded, and you only need one "!" before all excluded values the "," character is used to separate multiple values there should be no space following the comma the returned search results will contain devices with a name neither containing nor equal to "terso" and devices with a name neither containing nor equal to "solutions" and devices with a serial number neither containing nor equal to "1234" and devices with a serial number neither containing nor equal to "4321" and devices with a region neither containing nor equal to "us" and devices with a region neither containing nor equal to "ap" sort sort can be used on its own, separate from search, as follows in this example, we will be using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application and sort by the "name" property here’s how to do so https //api jetstreamrfid com/2/devices?sort=name notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the “name” value is a property of the device resource not all properties of a resource are sortable see the parameters table for each endpoint to determine which properties are sortable the returned results will contain devices ordered by their "name" property, in ascending order sort on multiple properties in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application and sort, first, by the "devicedefinition" property and, then, by the “region” property here’s how to do so https //api jetstreamrfid com/2/devices?sort=devicedefinition,region notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "devicedefinition" and "region" values are properties of the device resource not all properties of a resource are sortable see the parameters table for each endpoint to determine which properties are sortable the "," character is used to separate multiple values there should be no space following the comma the returned results will contain devices ordered by their "devicedefinition" property first, and then, by their "region" property within each "devicedefinition", in ascending order sort descending on one property in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application and sort by the “name” property, in descending order here’s how to do so https //api jetstreamrfid com/2/devices?sort= name notes the "https //api jetstreamrfid com/2/devices" part of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the " " character is used to sort the results in descending order – it must precede the value the "name" value is a property of the device resource not all properties of a resource are sortable see the parameters table for each endpoint to determine which properties are sortable the returned results will contain devices ordered by their "name" property, in descending order sort descending on multiple properties in this example, we will continue using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application and sort, first, by the "devicedefinition" property and, then, by the "region" property, in descending order here’s how to do so https //api jetstreamrfid com/2/devices?sort= devicedefinition, region notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the " " character is used to sort the results in descending order – it must precede each value the "devicedefinition" and "region" values are properties of the device resource not all properties of a resource are sortable see the parameters table for each endpoint to determine which properties are sortable the "," character is used to separate multiple values there should be no space following the comma the returned results will contain devices ordered, first, by their "devicedefinition" property and, then, by their "region" property within each "devicedefinition", in descending order search & sort search and sort can be used together as follows in this example, we will be using the get all devices docid\ zfynxz 5usnfgfgnx24i2 endpoint suppose you want to find all devices in your jetstream application containing the name "terso" and sort by the "region" property here’s how to do so https //api jetstreamrfid com/2/devices?name=terso\&sort=region notes the "https //api jetstreamrfid com/2/devices" section of the url indicates the get all devices endpoint the "?" separator indicates the start of the query string used for searching the "name" parameter is a property of the device resource not all properties of a resource are searchable see the parameters table for each endpoint to determine which properties are searchable the "&" character is used to separate multiple parameters there should be no spaces preceding nor following the ampersand in this case, it separates the search and sort parts of the query the "region" value is a property of the device resource not all properties of a resource are sortable see the parameters table for each endpoint to determine which properties are sortable the returned results will contain devices with a name containing and equal to "terso", ordered by their “region” property, in ascending order the key is to combine the search and sort parts of the query via the "&" character above is only one possible combination of search and sort to create a query reference the separate search and sort possibilities and combine them to create even more ways to search and sort version changes what's new? data interchange format json is now the data interchange format used by jetstream, replacing xml searching and sorting searching and sorting are available on the following jetstream api endpoints that return large result sets get all device definitions docid\ xnmyd7x5iixvo71ofvqoz get all devices docid\ zfynxz 5usnfgfgnx24i2 get all policies docid\ trcfpseda oo4vvkdn3dj new endpoints get a device docid\ oacn3m1uasctyqmj0h5yt replace all passes docid\ qp6qihbmdr1a 9kr7fekj get a device's policy docid\ nzayhlsoato1ubluao61x get a policy docid\ gukjvgtifpqku p3mxp4o what’s been replaced? endpoint (versions 1 0 1 5) replacement endpoint (version 2) getdevicedefinitions get all device definitions docid\ xnmyd7x5iixvo71ofvqoz getconfiguration get all devices docid\ zfynxz 5usnfgfgnx24i2 addlogicaldevice create a device docid 5aqyegsadygl0ggoej2z9 removelogicaldevice delete a device docid\ dzbc1ifmhu1ba9foppjro getpasses get all passes docid\ d7j1rxbgyehbv3bajwgsp updatepasses add or remove passes docid\ the3s6mtw3baeauul1a83 getepclistcommand get all rfid tags docid\ ci32mn8hwosbcmjmdu4tp lockdown lock a device docid\ wahzv ft98lwrpl3x2p0v adddevicetopolicy add a policy to a device docid\ u yihqpcnlvud3uag439e removedevicefrompolicy remove a policy from a device docid\ hvyi ktsc6abeiakhbv j getconfigvaluescommand get a device's configuration parameters docid 94vzb6djztjxfyzb78uj setconfigvaluescommand set a device's configuration parameters docid\ llqub1kfyhmeomohn 1fc resetcommand restart a device docid 9jcownfudipbznnnryfr0 getdevicestatus get device status docid\ f5qip zds7unfaackum16 unlockdoor unlock a device's door docid\ qdtewzyti 4vmdsnli9qm updatefirmwarecommand update firmware docid\ h9h679y t3yztcipn2gcz getevents get events docid yaqw97ir03lgkhnui2mb removeevents delete events docid 1z8wlwmzoguy dpo9sqgk addpolicy create a policy docid\ wswho jxi8iu09ehrtp2i getpolicies get all policies docid\ trcfpseda oo4vvkdn3dj removepolicy delete a policy docid\ q5nodf phwj1ehgak9kbh what’s been deprecated? devicefailureevent devicerestoreevent