1

I want to create identity network with Rooms and Sensors. I found in API documentation some example with Group :

curl -i -X POST \
   -H "Authorization: Bearer <ACCESS_TOKEN>" \
   -H "Content-Type: application/json" \
   -d \
"{
  \"context\": \"https://standards.lifeengine.io/v1/Context/Identity/Group/\",
  \"type\": \"Group\",
  \"data\": {
    \"name\": \"Company Oy\"
  }
}" "https://api-sandbox.oftrust.net/identities/v1"

How can I find out what I need to use as value for context if I want to create Room, Sensor?

Stanislav Kralin
  • 11,070
  • 4
  • 35
  • 58

1 Answers1

1

You can use Context API built by Platform of Trust. This API provides means to list available JSON-LD contexts of the Platform of Trust.

GET all supported contexts in the Platform using:

curl -i -X GET \
 "https://api-sandbox.oftrust.net/contexts/v1/"

For creating a Room identity you should do:

curl -i -X POST \
   -H "Authorization: Bearer <ACCESS_TOKEN>" \
   -H "Content-Type: application/json" \
   -d \
"{
  \"context\": \"https://standards.oftrust.net/v1/Context/Identity/Room/\",
  \"type\": \"Room\",
  \"data\": {
    \"name\": \"Bedroom\"
  }
}" "https://api-sandbox.oftrust.net/identities/v1"
ra_tester
  • 252
  • 1
  • 7