SETHOOK name endpoint [META name value ...] NEARBY|WITHIN|INTERSECTS key FENCE [DETECT what] [COMMANDS which] param [param ...]
Creates a webhook which points to a geofenced search. If a hook is already associated to that name, it’ll be overwritten.
Set a simple hook.
In this example we created a webhook named
warehouse that watches for changes to objects in the
fleet collection. When a change occurs the endpoint
'http://10.0.20.78/endpoint' is notified with a detailed message. The message contains a member named
'detect' which has one of the following values:
insideis when an object is inside the specified area.
outsideis when an object is outside the specified area.
enteris when an object that was not previously in the fence has entered the area.
exitis when an object that was previously in the fence has exited the area.
crossis when an object that was not previously in the fence has entered and exited the area.
For more information on the format of this message please see the topic on Geofencing.
Tile38 currently supports endpoints with the
disque url schemes.
HTTP / HTTPS
When using the
https:// url scheme an HTTP POST will be sent to the specified url with the
application/json and the request body containing the message.
Tile38 expects that the endpoint will respond with the status code of 200. As long as the status is 200 the message will be considered sent.
grpc:// url scheme provides support for sending messages over GRPC.
All webhook messages will be sent to the GPRC server at
The proto file can be found in the /hservice directory.
redis:// url scheme provides support for sending messages to a Redis server.
All webhook messages will be sent to the Redis server at
10.0.20.78:6379 in a PUBSUB queue
warehouse as a JSON messages.
disque:// url scheme provides support for sending messages to a Disque server.
All webhook messages will be sent to the Disque server at
10.0.20.78:7711. The replicate param is optional and when this value is greater than one, Tile38 will require that the Disque server to make copies of the message on N servers, where N is the value of
replicate. Please review the Disque API for information on the replicate option.
It’s possible to specify multiple endpoints for a webhook by separating each with a comma. Make sure that there are no spaces between the comma and the urls.
Tile38 will try to send a message to the first endpoint. If the send is a failure then the second endpoint is tried, and so on.