Sensors - Get Connection String

Gets a sensor connection string.

GET {endpoint}/sensor-partners/{sensorPartnerId}/sensors/{sensorId}/connection-strings?api-version=2023-11-01-preview

URI Parameters

Name In Required Type Description
endpoint
path True

string

uri

The host name of the namespace, e.g. admaInstanceName.farmbeats.azure.net

sensorId
path True

string

Id of the sensor resource.

sensorPartnerId
path True

string

Id of the sensor partner.

api-version
query True

string

The requested API version

Request Header

Name Required Type Description
Authorization True

string

Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before.

Responses

Name Type Description
200 OK

IoTHubDeviceAuthentication

Success

Other Status Codes

ErrorResponse

Error

Headers

x-ms-error-code: string

Security

Authorization

Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before.

Type: apiKey
In: header

Examples

Sensors_GetConnectionString

Sample request

GET {endpoint}/sensor-partners/sp1/sensors/s124/connection-strings?api-version=2023-11-01-preview

Sample response

{
  "primaryDeviceConnectionString": "HostName=iothubName.azure-devices.net;DeviceId=809f4379-b4d3-de01-6425-f088de6645f5;SharedAccessKey=****",
  "secondaryDeviceConnectionString": "HostName=iothubName.azure-devices.net;DeviceId=809f4379-b4d3-de01-6425-f088de6645f5;SharedAccessKey=****"
}

Definitions

Name Description
Error

An error from the Azure AgPlatform service.

ErrorResponse

An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document.

InnerError

Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.

IoTHubDeviceAuthentication

Authentication via connection string to IoTHub devices.

Error

An error from the Azure AgPlatform service.

Name Type Description
code

string

Server-defined set of error codes.

details

Error[]

Array of details about specific errors that led to this reported error.

innererror

InnerError

Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.

message

string

Human-readable representation of the error.

target

string

Target of the error.

ErrorResponse

An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document.

Name Type Description
error

Error

An error from the Azure AgPlatform service.

traceId

string

Unique trace Id.

InnerError

Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.

Name Type Description
code

string

Specific error code than was provided by the containing error.

innererror

InnerError

Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.

IoTHubDeviceAuthentication

Authentication via connection string to IoTHub devices.

Name Type Description
primaryDeviceConnectionString

string

Primary connection string of the ioTHub device.

secondaryDeviceConnectionString

string

Secondary connection string of the ioTHub device.