WEDA API: Create a Device

Version

WEDA Core v0.2.0

Description

This tutorial covers two methods for creating or registering a physical device within the WEDA Core platform.

1. Link or create a device to a specific organization.

Endpoint

POST /platform/solutions/api/v1/orgs/{orgId}/devices

Example Request

curl --location --request POST 'https://{domain}/platform/solutions/api/v1/orgs/3a1d40ed-4f97-aed8-c727-57704d3d5d2e/devices/physical'\
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}' \
--data '{
  "deviceId": "47a05d8769de",
  "hwModel": "MIC-710"
}'

Example Response

{
    "deviceId": "47a05d8769de",
    "hwModel": "MIC-710",
    "orgId": "3a1d40ed-4f97-aed8-c727-57704d3d5d2e",
    "status": "Registered"
}

2. Create a new device without specific organization.

Endpoint

POST /platform/solutions/api/v1/devices/physical

Example Request

curl --location --request POST 'https://{domain}/platform/solutions/api/v1/devices' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {access-token}' \
--data '{
  "deviceId": "47a05d8769de",
  "hwModel": "MIC-710"
}'

Example Response

{
    "deviceId": "47a05d8769de",
    "hwModel": "MIC-710",
    "orgId": null,
    "status": "Registered"
}