--- title: JWT tags: ThingsBoard image: https://i.imgur.com/aDx8RDT.png disque: hackmd --- JWT === :::info JSON Web Token(JWT) ::: >get-jwt-token.sh ```bash= curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"username":"your-tb-account@xxxxx.com", "password":"********"}' 'https://demo.thingsboard.io/api/auth/login' ``` >get-jwt-token.py ```python= import sys import requests import json def getToken(): url = 'https://demo.thingsboard.io/api/auth/login' headers = {'Content-Type': 'application/json', 'Accept': 'application/json'} loginJSON = {'username': 'your-tb-account@xxxxx.com', 'password': '********'} tokenAuthResp = requests.post(url, headers=headers, json=loginJSON).json() token = tokenAuthResp['token'] return token print(getToken()) ``` TB REST API - swagger --- :::warning value: JWT token前一定要記得加"Bearer " :::  * Example: telemetry-controller : Telemetry Controller * GET /api/plugins/telemetry/{entityType}/{entityId}/keys/timeseries * entityType: **DEVICE** (uppercase only) * entityId: d0b69750-d596-11eb-9381-************  Resource(s) --- * [Facebook ThingsBoard Taiwan Group](https://facebook.com/groups/thingsboard)
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up