Better than a thousand hollow words is one word that brings peace.

Overview

To use our RESTful API

  1. You need to get the JWT token that is associated with your account. There are two ways.

    1. You can manually sign into our website at https://getsmartx.com, go to the Users tab. The box titled "Self Information" contains information about you. The field titled "Token" is the JWT token. Please note, the JWT token excludes what is in the bracket "()" beneath. The content in the bracket is your user id.

    2. You can also obtain a JWT token programmatically by using our API. You can use the end point:

    https://getsmartx.com:3000/api/1/login

    to obtain the user object representing yourself. You just need to POST username and password to the API. If your credentials are correct, you should obtain an User object with the field token, which is your JWT token.

  2. The JWT token expires in two weeks, so you need to refresh the token by repeating the step above.

  3. Once you have the JWT token, you need to include a new field Authorization in the request header of all subsequent requests to our API end points. The content of the request header should be:

    JWT <JWT token>

  4. The API end points to access your sensor data are the following:

    1. For the latest data, use this API:

    GET https://getsmartx.com:3000/api/1/streams/latest/:device_id

    1. To get a set of data from a time period, use this API:

    GET https://getsmartx.com:3000/api/1/streams/listByDevice/:device_id

    You should also include from_time and to_time in unix timestamp format (miliseconds since epoch) in this request.


To use our MQTT realtime API

Using the MQTT realtime API allows you to be updated of the latest sensor data as it reaches our server. It is highly recommended that you use MQTT, instead of repeatedly querying our latest API end point. Here are the steps:

  1. Connect to our MQTT broker at:

    getsmartx.com

  2. You should use SSL (port 8884 for ssl or 1884 for non-secure connection). You should also authenticate by providing your username as username, and your JWT token as your password in your MQTT client.

  3. The topic to subscribe to is the following:

    <user_id>/<device_id>_D

    For example, if your user_id is 57cff9803bbb1229fd4da31b, and you want to connect to device 3e1000000000000000000000, you would subscribe to this topic:

    57cff9803bbb1229fd4da31b/3e1000000000000000000000_D

    1. Once subscribed, you should receive messages with a cmd field called UIStatus, which should contain the latest sensor update information.

    2. If you are subscribing to a mobile node, you will receive messages with a cmd field called UIPosition, which should contain details like Plot, which indicates which map the node is on, and the coordinates.


Sensor Information

The following is a list of all our sensors. For example, bed sensor related sensor_id is 186, 187, and 188.

sensor_id: 0, sensor_type: Positioning, unit: ;
sensor_id: 1, sensor_type: Temperature, unit: °C;
sensor_id: 2, sensor_type: Temperature, unit: °F;
sensor_id: 3, sensor_type: Percent, unit: %;
sensor_id: 4, sensor_type: Humidity, unit: %RH;
sensor_id: 5, sensor_type: Acidity, unit: pH;
sensor_id: 6, sensor_type: Oxygen Concentration, unit: %O2;
sensor_id: 7, sensor_type: Concentration, unit: mg/L;
sensor_id: 8, sensor_type: Speed, unit: m/S;
sensor_id: 9, sensor_type: Speed, unit: knots;
sensor_id: 10, sensor_type: Meter, unit: Meter;
sensor_id: 11, sensor_type: Feet, unit: Feet;
sensor_id: 12, sensor_type: PFH, unit: PFH;
sensor_id: 13, sensor_type: CO Concentration, unit: PPM CO;
sensor_id: 14, sensor_type: CO2 Concentration, unit: PPM CO2;
sensor_id: 15, sensor_type: , unit: ;
sensor_id: 16, sensor_type: Speed, unit: Km/h;
sensor_id: 17, sensor_type: Speed, unit: ft/min;
sensor_id: 18, sensor_type: Speed, unit: mile/h;
sensor_id: 19, sensor_type: Time, unit: µS;
sensor_id: 20, sensor_type: Time, unit: mS;
sensor_id: 21, sensor_type: Illuminance, unit: LUX;
sensor_id: 22, sensor_type: Illuminance, unit: Ft-cd;
sensor_id: 23, sensor_type: Intensity, unit: dB;
sensor_id: 24, sensor_type: mV, unit: mV;
sensor_id: 25, sensor_type: Concentration, unit: ppm;
sensor_id: 26, sensor_type: °C_DEW, unit: °C_DEW;
sensor_id: 27, sensor_type: °F_DEW, unit: °F_DEW;
sensor_id: 28, sensor_type: °C_WET, unit: °C_WET;
sensor_id: 29, sensor_type: °F_WET, unit: °F_WET;
sensor_id: 30, sensor_type: , unit: ;
sensor_id: 31, sensor_type: , unit: ;
sensor_id: 32, sensor_type: Weight, unit: mg;
sensor_id: 33, sensor_type: Magnetic Flux Density, unit: tesla;
sensor_id: 34, sensor_type: Air Pressure, unit: BAR;
sensor_id: 35, sensor_type: Air Pressure, unit: PSI;
sensor_id: 36, sensor_type: Air Pressure, unit: cm Hg;
sensor_id: 37, sensor_type: Air Pressure, unit: inch H2O;
sensor_id: 38, sensor_type: Air Pressure, unit: Atmosphere;
sensor_id: 39, sensor_type: Frequency of Rotation, unit: RPM;
sensor_id: 40, sensor_type: Speed, unit: inch/min;
sensor_id: 41, sensor_type: Speed, unit: cm/min;
sensor_id: 42, sensor_type: , unit: ;
sensor_id: 43, sensor_type: , unit: ;
sensor_id: 44, sensor_type: , unit: ;
sensor_id: 45, sensor_type: , unit: ;
sensor_id: 46, sensor_type: , unit: ;
sensor_id: 47, sensor_type: , unit: ;
sensor_id: 48, sensor_type: Count, unit: Count;
sensor_id: 49, sensor_type: Frequency, unit: Hz ;
sensor_id: 50, sensor_type: Degree, unit: Degree;
sensor_id: 51, sensor_type: Frequency, unit: KHZ;
sensor_id: 52, sensor_type: Voltage, unit: V (DCV);
sensor_id: 53, sensor_type: Current, unit: uA (DC);
sensor_id: 54, sensor_type: Current, unit: A (DC);
sensor_id: 55, sensor_type: Current, unit: mA (DC);
sensor_id: 56, sensor_type: Resistance, unit: OHM;
sensor_id: 57, sensor_type: Resistance, unit: K OHM;
sensor_id: 58, sensor_type: , unit: ;
sensor_id: 59, sensor_type: , unit: ;
sensor_id: 60, sensor_type: , unit: ;
sensor_id: 61, sensor_type: , unit: ;
sensor_id: 62, sensor_type: , unit: ;
sensor_id: 63, sensor_type: , unit: ;
sensor_id: 64, sensor_type: Resistance, unit: M OHM;
sensor_id: 65, sensor_type: mH, unit: mH;
sensor_id: 66, sensor_type: H, unit: H;
sensor_id: 67, sensor_type: nF (cap), unit: nF (cap);
sensor_id: 68, sensor_type: uF, unit: uF;
sensor_id: 69, sensor_type: Hfe, unit: Hfe;
sensor_id: 70, sensor_type: DIODE, unit: DIODE;
sensor_id: 71, sensor_type: WATT, unit: WATT;
sensor_id: 72, sensor_type: K WATT, unit: K WATT;
sensor_id: 73, sensor_type: ACmV, unit: ACmV;
sensor_id: 74, sensor_type: , unit: ;
sensor_id: 75, sensor_type: , unit: ;
sensor_id: 76, sensor_type: , unit: ;
sensor_id: 77, sensor_type: , unit: ;
sensor_id: 78, sensor_type: , unit: ;
sensor_id: 79, sensor_type: , unit: ;
sensor_id: 80, sensor_type: ACV, unit: ACV;
sensor_id: 81, sensor_type: ACuA, unit: ACuA;
sensor_id: 82, sensor_type: ACA, unit: ACA;
sensor_id: 83, sensor_type: ACmA, unit: ACmA;
sensor_id: 84, sensor_type: COSΦ (PF), unit: COSΦ (PF);
sensor_id: 85, sensor_type: Weight, unit: Kg;
sensor_id: 86, sensor_type: Weight, unit: Lb;
sensor_id: 87, sensor_type: Weight, unit: g;
sensor_id: 88, sensor_type: Weight, unit: oz;
sensor_id: 89, sensor_type: Force, unit: NEWTON (G);
sensor_id: 90, sensor_type: , unit: ;
sensor_id: 91, sensor_type: , unit: ;
sensor_id: 92, sensor_type: , unit: ;
sensor_id: 93, sensor_type: , unit: ;
sensor_id: 94, sensor_type: , unit: ;
sensor_id: 95, sensor_type: , unit: ;
sensor_id: 96, sensor_type: M/Min, unit: M/Min;
sensor_id: 97, sensor_type: Hour, unit: Hour;
sensor_id: 98, sensor_type: Minutes, unit: Minutes;
sensor_id: 99, sensor_type: VA (VA), unit: VA (VA);
sensor_id: 100, sensor_type: KVA (K(VA)), unit: KVA (K(VA));
sensor_id: 101, sensor_type: kWhr, unit: kWhr;
sensor_id: 102, sensor_type: mF (cap), unit: mF (cap);
sensor_id: 103, sensor_type: MHz, unit: MHz;
sensor_id: 104, sensor_type: uH, unit: uH;
sensor_id: 105, sensor_type: dBm, unit: dBm;
sensor_id: 106, sensor_type: , unit: ;
sensor_id: 107, sensor_type: , unit: ;
sensor_id: 108, sensor_type: , unit: ;
sensor_id: 109, sensor_type: , unit: ;
sensor_id: 110, sensor_type: , unit: ;
sensor_id: 111, sensor_type: , unit: ;
sensor_id: 112, sensor_type: Red, unit: Red;
sensor_id: 113, sensor_type: Green, unit: Green;
sensor_id: 114, sensor_type: Blue, unit: Blue;
sensor_id: 115, sensor_type: Saturation, unit: Saturation;
sensor_id: 116, sensor_type: m SEC, unit: m SEC;
sensor_id: 117, sensor_type: u SEC, unit: u SEC;
sensor_id: 118, sensor_type: SEC, unit: SEC;
sensor_id: 119, sensor_type: Kg/cm2, unit: Kg/cm2;
sensor_id: 120, sensor_type: mm Hg, unit: mm Hg;
sensor_id: 121, sensor_type: Meter H2O, unit: Meter H2O;
sensor_id: 122, sensor_type: , unit: ;
sensor_id: 123, sensor_type: , unit: ;
sensor_id: 124, sensor_type: , unit: ;
sensor_id: 125, sensor_type: , unit: ;
sensor_id: 126, sensor_type: , unit: ;
sensor_id: 127, sensor_type: , unit: ;
sensor_id: 128, sensor_type: inch Hg, unit: inch Hg;
sensor_id: 129, sensor_type: Kg-cm, unit: Kg-cm;
sensor_id: 130, sensor_type: Lb-inch, unit: Lb-inch;
sensor_id: 131, sensor_type: N-cm, unit: N-cm;
sensor_id: 132, sensor_type: CMM, unit: CMM;
sensor_id: 133, sensor_type: CFM, unit: CFM ;
sensor_id: 134, sensor_type: m BAR, unit: m BAR;
sensor_id: 135, sensor_type: PA (Pressure), unit: PA (Pressure);
sensor_id: 136, sensor_type: K PA, unit: K PA;
sensor_id: 137, sensor_type: um Hg, unit: um Hg;
sensor_id: 138, sensor_type: , unit: ;
sensor_id: 139, sensor_type: , unit: ;
sensor_id: 140, sensor_type: , unit: ;
sensor_id: 141, sensor_type: , unit: ;
sensor_id: 142, sensor_type: , unit: ;
sensor_id: 143, sensor_type: , unit: ;
sensor_id: 144, sensor_type: TORR, unit: TORR;
sensor_id: 145, sensor_type: H PA, unit: H PA;
sensor_id: 146, sensor_type: m/(Sec^2), unit: m/(Sec^2);
sensor_id: 147, sensor_type: mm/Sec, unit: mm/Sec;
sensor_id: 148, sensor_type: mm, unit: mm;
sensor_id: 149, sensor_type: cm/Sec, unit: cm/Sec;
sensor_id: 150, sensor_type: inch, unit: inch;
sensor_id: 151, sensor_type: Ft/(Sec^2), unit: Ft/(Sec^2);
sensor_id: 152, sensor_type: inch/Sec, unit: inch/Sec;
sensor_id: 153, sensor_type: Luminance, unit: Luminance;
sensor_id: 154, sensor_type: , unit: ;
sensor_id: 155, sensor_type: , unit: ;
sensor_id: 156, sensor_type: , unit: ;
sensor_id: 157, sensor_type: , unit: ;
sensor_id: 158, sensor_type: , unit: ;
sensor_id: 159, sensor_type: , unit: ;
sensor_id: 160, sensor_type: Meter^2, unit: Meter^2;
sensor_id: 161, sensor_type: Feets, unit: Feets;
sensor_id: 162, sensor_type: %Salt, unit: %Salt;
sensor_id: 163, sensor_type: Hue, unit: Hue;
sensor_id: 164, sensor_type: pF, unit: pF;
sensor_id: 165, sensor_type: Q (for L) Quality, unit: Q (for L) Quality;
sensor_id: 166, sensor_type: D (for C) Dissipation, unit: D (for C) Dissipation;
sensor_id: 167, sensor_type: V/m, unit: V/m;
sensor_id: 168, sensor_type: mW/cm^2, unit: mW/cm^2;
sensor_id: 169, sensor_type: W/m^2, unit: W/m^2;
sensor_id: 170, sensor_type: , unit: ;
sensor_id: 171, sensor_type: , unit: ;
sensor_id: 172, sensor_type: , unit: ;
sensor_id: 173, sensor_type: , unit: ;
sensor_id: 174, sensor_type: , unit: ;
sensor_id: 175, sensor_type: , unit: ;
sensor_id: 176, sensor_type: uW/cm^2, unit: uW/cm^2;
sensor_id: 177, sensor_type: m OHM, unit: m OHM;
sensor_id: 178, sensor_type: u tesla, unit: u tesla;
sensor_id: 179, sensor_type: m gauss, unit: m gauss;
sensor_id: 180, sensor_type: u gauss, unit: u gauss;
sensor_id: 181, sensor_type: gauss, unit: gauss;
sensor_id: 182, sensor_type: KACV, unit: KACV;
sensor_id: 183, sensor_type: MACV, unit: MACV;
sensor_id: 184, sensor_type: KACA, unit: KACA;
sensor_id: 185, sensor_type: MACA, unit: MACA;
sensor_id: 186, sensor_type: Bed Vibration Sensor, unit: ;
sensor_id: 187, sensor_type: Pulse Sensor, unit: BPM;
sensor_id: 188, sensor_type: Respiration Rate Sensor, unit: breaths/min;
sensor_id: 189, sensor_type: , unit: ;
sensor_id: 190, sensor_type: , unit: ;
sensor_id: 191, sensor_type: , unit: ;
sensor_id: 192, sensor_type: MW, unit: MW;
sensor_id: 193, sensor_type: GW, unit: GW;
sensor_id: 194, sensor_type: TW, unit: TW ;
sensor_id: 195, sensor_type: MVA, unit: MVA ;
sensor_id: 196, sensor_type: GVA, unit: GVA;
sensor_id: 197, sensor_type: TVA, unit: TVA;
sensor_id: 198, sensor_type: KVAR, unit: KVAR;
sensor_id: 199, sensor_type: MVAR, unit: MVAR;
sensor_id: 200, sensor_type: GVAR, unit: GVAR;
sensor_id: 201, sensor_type: TVAR, unit: TVAR;
sensor_id: 202, sensor_type: Switch, unit: ;
sensor_id: 203, sensor_type: Dimmer   , unit: ;
sensor_id: 204, sensor_type: Siren  , unit: ;
sensor_id: 205, sensor_type: Curtain    , unit: ;
sensor_id: 206, sensor_type: Remote , unit: ;
sensor_id: 207, sensor_type: , unit: ;
sensor_id: 208, sensor_type: MWh, unit: MWh;
sensor_id: 209, sensor_type: GWh, unit: GWh;
sensor_id: 210, sensor_type: TWh, unit: TWh;
sensor_id: 211, sensor_type: KVAh, unit: KVAh;
sensor_id: 212, sensor_type: MVAh, unit: MVAh;
sensor_id: 213, sensor_type: GVAh, unit: GVAh;
sensor_id: 214, sensor_type: TVAh, unit: TVAh;
sensor_id: 215, sensor_type: KVARh, unit: KVARh;
sensor_id: 216, sensor_type: MVARh, unit: MVARh;
sensor_id: 217, sensor_type: GVARh, unit: GVARh;
sensor_id: 218, sensor_type: CO Sensor , unit: ;
sensor_id: 219, sensor_type: CO2 Sensor , unit: ;
sensor_id: 220, sensor_type: Flood Sensor      , unit: ;
sensor_id: 221, sensor_type: Glass Break Sensor, unit: ;
sensor_id: 222, sensor_type: Meter Sensor, unit: ;
sensor_id: 223, sensor_type: , unit: ;
sensor_id: 224, sensor_type: TVARh, unit: TVARh;
sensor_id: 225, sensor_type: UVI, unit: UVI;
sensor_id: 226, sensor_type: NTU, unit: NTU;
sensor_id: 227, sensor_type: m tesla, unit: m tesla;
sensor_id: 228, sensor_type: (M^3)/H, unit: (M^3)/H ;
sensor_id: 229, sensor_type: Lit/H, unit: Lit/H;
sensor_id: 230, sensor_type: VAR, unit: VAR;
sensor_id: 231, sensor_type: Wh/m^2, unit: Wh/m^2;
sensor_id: 232, sensor_type: Wh/m^2/h, unit: Wh/m^2/h;
sensor_id: 233, sensor_type: Btu/ft^2h, unit: Btu/ft^2h;
sensor_id: 234, sensor_type: Door / Window Sensor, unit: ;
sensor_id: 235, sensor_type: PIR Sensor, unit: ;
sensor_id: 236, sensor_type: Humidity Sensor, unit: ;
sensor_id: 237, sensor_type: GPIO, unit: ;
sensor_id: 238, sensor_type: Smoke Sensor, unit: ;
sensor_id: 239, sensor_type: , unit: ;
sensor_id: 240, sensor_type: Btu/ft^2/h, unit: Btu/ft^2/h;
sensor_id: 241, sensor_type: Btu/ft^2, unit: Btu/ft^2;
sensor_id: 242, sensor_type: Whr, unit: Whr;
sensor_id: 243, sensor_type: mW/m^2, unit: mW/m^2;
sensor_id: 244, sensor_type: uW/m^2, unit: uW/m^2;
sensor_id: 245, sensor_type: u OHM, unit: u OHM;
sensor_id: 246, sensor_type: db_B, unit: db_B;
sensor_id: 247, sensor_type: db_A, unit: db_A;
sensor_id: 248, sensor_type: db_C, unit: db_C;
sensor_id: 249, sensor_type: PF, unit: PF;
sensor_id: 250, sensor_type: , unit: ;
sensor_id: 251, sensor_type: , unit: ;
sensor_id: 252, sensor_type: , unit: ;
sensor_id: 253, sensor_type: , unit: ;
sensor_id: 254, sensor_type: Debug Message, unit: Debug;
sensor_id: 255, sensor_type: Alive Message, unit: Alive;