HTTP API
If you just want to send OOCSI messages to a channel or client, for instance, to trigger something or make a selection, you can do this with the HTTP API. Letās say your OOCSI server is available at https://demo.oocsi.net, then you can send an OOCSI message with a simple parameter ātestingThisā to the channel test-http-api
with:
https://demo.oocsi.net/send/test-http-api/testingThis
The first part is the server URL, then you add /send/
and then the channel test-http-api
, then /
and finally, you append the parameter testingThis
.
If you would like to send more structured data, you need to send a POST request to the URL:
https://demo.oocsi.net/send/test-http-api
The POST request needs to have a JSON formatted body or url-encoded form content.
On the command line, this would look like this:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"color":"blue","number":12,"light":true}' \
https://demo.oocsi.net/send/test-http-api
Use example: Using QR codes with OOCSI
Now that you know how to create URLs that send data to OOCSI when they are opened in a browser, you can make QR codes of these URLs and let people scan them.
Identifying users with cookies
The HTTP API uses HTML cookies to remember browsers. So, when a browser (on a laptop or mobile phone) opens one of the HTTP API URLs that you have created, OOCSI will also set a cookie on this browser. The next time (within 24 hours) that the browser opens the same or another HTTP API URL, the cookie will be recognized and you will receive the same user id. This way, you can track different users in an application.
Note, that these cookies do not store personal information and they expire after 24 hours. Nevertheless, you might need to inform your users or participants about this.