V2/Concepts/API Key

From Senfi Docs
Revision as of 14:41, 24 June 2021 by Huiyan (talk | contribs)
Jump to: navigation, search

API Key

Authentication is required for Connectors to send data to Senfi. This is done through the use of API Key (integration key/secret pair) which you can generated in the CMS. View below to understand how the API Key is used in different methods of data sending to Senfi.

Sending data via MQTT

The API Key (integration key/secret pair) has to be first generated in the CMS. After obtaining the API Key, include the API Key as the Username and Password in the MQTT Endpoint.

MQTT Endpoint

Host
mqtt.senfi.io
Port
1883
Username
<Your integration key>
Password
<Your integration secret>
MQTT topic
ingestor/1/0/live/text/array/ems/<your integration key>/<your measurement code>

Sending data via Senfi API

API Key is needed for making authenticated requests to the Senfi API. Senfi API uses OAuth2 to authenticate requests. Authenticating via OAuth2 requires the following steps:

  1. Create an API Key
  2. Generate an access token
  3. Make authenticated requests to the Senfi API

The API Key (integration key/secret pair) has to be first generated in the CMS. After obtaining the API Key, a call can be made via the Token API call operation to obtain an access token which will then be used in subsequent API calls for authentication.

What's Next