Control Services API

Skykit Control Services API

Services for managing Skykit devices.

www.skykit.com



Generate a private and public key-pair using OpenSSL:
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform PEM -pubout -out public.pem
Send your public key to Skykit Support ([email protected]), including the email address that you wish the key to be associated with. Keep your private key safe.

To generate the autorization bearer token (via javascript):
const jwt = require('jsonwebtoken');
const tenant = "replace with your provided tenant code";
const privateKey = "your private key"
const exp = Math.floor(Date.now() / 1000) + (60 * 60);
const iat = Math.floor(Date.now() / 1000);
const claims = {
'iss': tenant,
'iat': iat, // issued at time
'exp': exp, // expiration time.
'tenantCode': tenant,
'apiToken': true
};
const token = jwt.sign(claims, privateKey, {algorithm: 'RS256'});