Giter VIP home page Giter VIP logo

devdocs's Introduction

HypeRate DevDocs

Getting a API key

You need to request your websocket key on our Webpage.

I don't have a compatible device! What should I do?

The API sends sends a random heartbeat between 60 and 80 every second to the internal-testing device id.

Connecting to the API

URL: wss://app.hyperate.io/socket/websocket?token=<MY-WEBSOCKET-KEY>

Required websocket messages

Join Channel

You need to join the appropiate channel before any data will be send to your client.

To do this you need to send the following JSON message:

{
	"topic": "hr:<ID>",
	"event": "phx_join",
	"payload": {},
	"ref": 0
}

This would be the correct message to join the "internal-testing" channel:

{
	"topic": "hr:internal-testing",
	"event": "phx_join",
	"payload": {},
	"ref": 0
}

Send heartbeat

Phoenix expects that you send the heartbeat every 10 seconds otherwise the connection will be closed.

{
	"topic": "phoenix",
	"event": "heartbeat",
	"payload": {},
	"ref": 0
}

Leave channel

In case you only want to leave a joined channel you can send the following message:

{
	"topic": "hr:<ID>",
	"event": "phx_leave",
	"payload": {},
	"ref": 0
}

This would be the correct message to leave the "internal-testing" channel:

{
	"topic": "hr:internal-testing",
	"event": "phx_leave",
	"payload": {},
	"ref": 0
}

devdocs's People

Contributors

alexholzreiter avatar yannickfricke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

cyantabby

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.