IotHub
  1. token
IotHub
  • README
  • token
    • createToken
      POST
    • destroyToken
      POST
  • customer
    • customerPage
      POST
    • customerTree
      POST
  • device
    • command
      • commandSend
      • commandInfoList
      • cutOilElectric
      • getConfig
    • devicePage
      POST
    • deviceTypes
      POST
    • deviceTypeInfo
      POST
    • deviceDataByDeviceIds
      POST
    • deviceDataByCustomerId
      POST
    • deviceTripInfoByTripId
      POST
    • deviceTripsByDeviceId
      POST
    • deviceTraffic
      POST
    • deviceSensorData
      POST
    • expandInfoByDeviceId
      POST
    • saveDeviceChannelName
      POST
  • fence
    • fencePage
      POST
    • fenceInfo
      POST
    • addFence
      POST
    • saveFence
      POST
    • delFence
      POST
    • fenceDevices
      POST
    • fenceDeviceUpdate
      POST
    • fenceDeviceDel
      POST
    • fenceDeviceAdd
      POST
  • push&Webhook
    • README
  • video
    • H5 page
    • H5 Page-V2
    • history
      • README
      • playBackList
      • historicalUpload
      • playBack
      • replaySet
      • taskPage
      • taskStop
      • taskDelete
    • live
      • liveVideo
      • liveVideoControl
    • getNodes
  • alarm
    • Alert Types
    • alarmTypeList
    • alarmFilePage
    • alarmFileByAlarmId
    • alarmHistoryPage
    • alarmPageByUser
  • audio
    • README
    • talk「Deprecated」
    • talkPlus
  • gallery
    • filePageV2
    • filePage
    • deleteFile
    • capture
    • capturePage
    • captureRecord
  • fleet
    • faceRecordPage
    • rfidPage
  • gps
    • historyData
  • Protocol Analysis
    POST
  1. token

createToken

POST
/v2/openapi/system/createToken
Once a token is generated, it will expire if it is not used for more than 4 hours and needs to be re-acquired.
The maximum usage time of a token is 48 hours.
Put the token into the Authorization field of the header of other interfaces.

Request

Authorization
Add parameter in header
Authorization
Example:
Authorization: ********************
Header Params

Body Params application/json

Example
{"apiKey":"{{apiKey}}","apiSecret":"{{apiSecret}}"}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://mettahub.mettaxiot.com/gps/v2/openapi/system/createToken' \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data-raw '{"apiKey":"{{apiKey}}","apiSecret":"{{apiSecret}}"}'

Responses

🟢200Success
application/json
Body

Example
{
  "code": 0,
  "data": "",
  "msg": ""
}
Modified at 2025-12-03 02:17:01
Previous
README
Next
destroyToken
Built with