Skip to content

Generate User Token

Craig Hesling edited this page Jul 18, 2018 · 2 revisions

User ID and User Token

You can have applications interact with OpenChirp REST or MQTT with the same access level as your user. To do this without OAuth, use your User ID and generated User Token.

Here are some example use cases.

  • Commandline cURL
    curl -u USER_ID:USER_TOKEN https://api.openchirp.io/apiv1/device/DEVICE_ID/transducer/TRANSDUCER_NAME
  • Mosquitto subscribe tool
    mosquitto_sub -v -i monitor$RANDOM -h mqtt.openchirp.io -p 8883 --capath /etc/ssl/certs -u 'USER_ID' -P 'USER_TOKEN' -t 'openchirp/device/#'

Obtain User ID and User Token

The following show the steps neccesary to obtain your User ID and User Token:

  1. Login to OpenChirp.io using your Google account. Click LOGIN in the top-right corner to start. Login page
  2. Click on your name in the top-right corner Dashboard after login
  3. Click My Profile Account dropdown
  4. Make note of your User ID, this is tyocially refered to as USER_ID in other tutorials. My profile page
  5. Click Generate Token. A message box should appear that says Success and contains a Token. Make note of this Token, we will typically refer to this as the USER_TOKEN in other tutorials. Generated token page