Discovery API
To start the process you need to call the discovery API by passing a few parameters to fetch Identity Endpoint. For this, You need CPID or SID, IOTConnect-supported language, version, and environment.If you do not find the discovery URL, You can find your associated discovery URL in the Key Vault of your account IoTConnect portal “Settings -> Key vault”.
CPID Based
Base Url : URL_FROM_KEY_VAULT
Endpoint :/api/v2.1/dsdk/cpId/[COMPANY_CPID]/env/[COMPANY_ENVIRONMENT]
Method : GET
Example:
Request:
http://URL_FROM_KEY_VAULT/api/v2.1/dsdk/cpId/[COMPANY_CPID]/env/[COMPANY_ENVIRONMENT]
SID Based
Base Url : URL_FROM_KEY_VAULT
Endpoint :/api/v2.1/dsdk/sid/[COMPANY_SID]
Method : GET
Example:
Request:
http://URL_FROM_KEY_VAULT/api/v2.1/dsdk/sid/[COMPANY_SID]
Response:
{
"d": {
"ec": 0, // Error Code: [Ref] 0 – No error
"bu": "", // Base URL of the Identity service
"log:mqtt": { // MQTT connection details to optionally send device logging
"hn": "", // Hostname of MQTT broker
"un": "", // Username to connect MQTT broker
"pwd": "", // Password to connect MQTT broker
"topic": "" // Topic on which log messages can be sent
},
"pf": "aws" // value may vary based on the broker
},
"status": 200,
"message": "Success" // based on the value of ec
// 0 – Success
// 1 – Invalid value of CPID
// 2 – Company not found
// 3 – Subscription Expired
}