Share via


Sensors - List

Returns a paginated list of sensor resources.

GET {endpoint}/sensor-partners/{sensorPartnerId}/sensors?api-version=2023-11-01-preview
GET {endpoint}/sensor-partners/{sensorPartnerId}/sensors?sensorDataModelIds={sensorDataModelIds}&sensorMappingIds={sensorMappingIds}&deviceIds={deviceIds}&ids={ids}&names={names}&propertyFilters={propertyFilters}&statuses={statuses}&minCreatedDateTime={minCreatedDateTime}&maxCreatedDateTime={maxCreatedDateTime}&minLastModifiedDateTime={minLastModifiedDateTime}&maxLastModifiedDateTime={maxLastModifiedDateTime}&maxPageSize={maxPageSize}&skipToken={skipToken}&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

sensorPartnerId
path True

string

Id of the associated sensor partner.

api-version
query True

string

The requested API version

deviceIds
query

string[]

Id's of the devices.

ids
query

string[]

Ids of the resource.

maxCreatedDateTime
query

string (date-time)

Maximum creation date of resource (inclusive).

maxLastModifiedDateTime
query

string (date-time)

Maximum last modified date of resource (inclusive).

maxPageSize
query

integer (int32)

minimum: 10
maximum: 1000

Maximum number of items needed (inclusive). Minimum = 10, Maximum = 1000, Default value = 50.

minCreatedDateTime
query

string (date-time)

Minimum creation date of resource (inclusive).

minLastModifiedDateTime
query

string (date-time)

Minimum last modified date of resource (inclusive).

names
query

string[]

Names of the resource.

propertyFilters
query

string[]

Filters on key-value pairs within the Properties object. eg. "{testKey} eq {testValue}".

sensorDataModelIds
query

string[]

Id's of the sensor data models.

sensorMappingIds
query

string[]

Ids of the sensor mappings.

skipToken
query

string

Skip token for getting next set of results.

statuses
query

string[]

Statuses of the resource.

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

SensorListResponse

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_List

Sample request

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

Sample response

{
  "value": [
    {
      "sensorDataModelId": "sdm124",
      "integrationId": "string",
      "hardwareId": "SMHD-456",
      "deviceId": "d124",
      "type": "SM",
      "location": {
        "latitude": 23.5,
        "longitude": 42.7
      },
      "port": {
        "name": "measure",
        "type": "digital"
      },
      "sensorPartnerId": "sp1",
      "id": "s124",
      "status": "sm created",
      "createdDateTime": "2022-01-24T06:27:05Z",
      "modifiedDateTime": "2022-01-24T06:27:31Z",
      "eTag": "04019fed-0000-0700-0000-61ee46d30000",
      "name": "my new sm",
      "description": "description for sensor goes here",
      "properties": {
        "key1": "value1",
        "key2": 123.45
      }
    }
  ],
  "skipToken": "skipToken",
  "nextLink": "https://{{resourceName}}.farmbeats.azure.net/sensor-partners/{{sensorPartnerId}}/device-data-models?api-version={{apiVersion}}&skipToken=%5b%7b%22token%22%3a%22%2bRID%3a%7e23TRC%3a10%23ISA%3d%22%2c%22range%22%3a%7b%22min%22%3a%22%22%2c%22max%22%3a%22FF%22%7d%7d%5d"
}

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.

Location

Location model class.

Port

Schema for storing port values.

Sensor

Sensor API model.

SensorListResponse

Paged response contains list of requested objects and a URL link to get the next set of results.

Error

An error from the Azure AgPlatform service.

Name Type Description
code

string

minLength: 1

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

minLength: 1

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.

Location

Location model class.

Name Type Description
latitude

number (double)

minimum: -90
maximum: 90

Latitude of the location.

longitude

number (double)

minimum: -180
maximum: 180

Longitude of the location.

Port

Schema for storing port values.

Name Type Description
name

string

minLength: 1
maxLength: 50

Name of the port.

type

string

minLength: 0
maxLength: 100

Type of port digital/analog.

Sensor

Sensor API model.

Name Type Description
createdBy

string

Created by user/tenant id.

createdDateTime

string (date-time)

Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.

depthInMeters

number[] (double)

Depth of each sensor measure in meters. Like sensor moisture at 2m, 4m, 6m.

description

string

minLength: 0
maxLength: 500

Textual description of the resource.

deviceId

string

Id of the associated device.

eTag

string

The ETag value to implement optimistic concurrency.

hardwareId

string

Id of the associated hardware.

id

string

Id of the resource.

integrationId

string

Integration id for the device.

location

Location

Location model class.

modifiedBy

string

Modified by user/tenant id.

modifiedDateTime

string (date-time)

Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.

name

string

minLength: 0
maxLength: 100

Name to identify resource.

port

Port

Schema for storing port values.

properties

A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 150 characters. Note: A maximum of 25 key value pairs can be provided for a resource and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.

sensorDataModelId

string

Id of the associated sensor data model.

sensorPartnerId

string

Id of the associated sensor partner.

status

string

minLength: 0
maxLength: 100

Status of the resource.

type

string

minLength: 0
maxLength: 100

Type of sensor.

SensorListResponse

Paged response contains list of requested objects and a URL link to get the next set of results.

Name Type Description
nextLink

string

Continuation link (absolute URI) to the next page of results in the list.

skipToken

string

Token used in retrieving the next page. If null, there are no additional pages.

value

Sensor[]

List of requested objects.