API Connectors Tutorial смотреть онлайн
This video will introduce the Sewio's API to you, also with a practical example by using the Websockets connector.
See more: http://www.sewio.net
Transcript:
Hi, in this tutorial we are going to show you how to program your own client connectors. Especialy connectors for REST API for getting list of all possible objects in your RTLS, and web socket API for getting position data and other information from tags.
We are going to look at the API documentation first. It could be accessed from our RTLS studio. There is an interactive demo with every endpoint of our api. For example if we would like to get the list of all anchors we simply call our anchors endpoint with get method. The response and all the data are documented in this demo. Why don't we try writing our own rest api client connector for getting all feeds?
Let's begin with a blank web page with opened console window. On the right side we have a javascript file of this web page.
First of all we are going to define our constants. This is an IP address of your RTLS server. This is an API key for accessing our data.
Then we are going to create function for getting all feeds. We are going to need XML HTTP request. If the query was successful we are going to call our callback function with the data we recieved. As stated in the api documentation, we are going to send blank get method on our server i p slash sensmap server slash api slash feeds. Let's call our function and print the response in our callback.
As you can see there are 4 objects recieved from our server. One anchor, two tags, and one building with one plan. You can go through the data if you want.
The websocket documentation could be accessed from rtls studio as well. All information is provided in this documentation. We are going to write our own tag subscription.
Let's create another function. This one will subscribe to our tag feed. It could be done using web socket. Websocket service is by default running on port 8080. Then again we are going to pass the response message to our defined callback. The message we are going to send to our web socket has following format. There are three keys, headers, method, and resource. In headers we are going to specify our api key. In method we are going to select subscribe method. And in resource we are going to specify what resource we would like to subscribe to. In this case it is our feed i d. Finally we are going to call our function.
Okay let's move our tag a little bit. These are the tag data from our server. There is x position, y position, clr, which has value over 9000 because we only have one anchor for presence detection, and in the last place the quaternion rotation of our tag because we have rotation enabled in our tag sensor setting.
If you want to recieve raw data of your tag. Please reconfigure it via rtls manager. Here is the example of what raw data looks like in our client application.
For more information about web socket and api please visit the documentation. Stay tuned and thanks for watching.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «API Connectors Tutorial» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.