NAV Navbar
shell java python javascript

Platform of Trust API Documentation

What is Platform of Trust?

Communally built Platform of Trust provides a trustworthy and easy-to-use surrounding where you can utilize a vast data pool and develop everyday services for your customers with the help from the developer community and without a need for pricey and time-consuming integrations.

Platform of Trust has Finnish origins, but it’s built to expand globally through the network of built environment innovation hubs.

More resources & support

Developer Portal

Our Developer Portal is your one-stop-shop. From there you'll find getting started guides, API descriptions, use case descriptions and link to API documentation.

End-to-end developer experience

APIs play crucial role in our end-end-end developer experience from integrating data to creating valuable applications. API -first experience and consistent APIs are important to us and thus we have created (work in progress) API Design Guide to offer guidance for our distributes API development teams.

End-to-end developer experience in Platform of Trust

Market place

Market place is the bazaar to find more data products to use in application development. Visa versa, it is also the service where your data products are added during the integration process. You can list data products in the market place with Product API.

Getting started

Some instructions and tips to make your life easier (and less support requests to us):

  • Create an account in sandbox environment from https://world-sandbox.oftrust.net/

  • Endpoints related code examples are constructed against SANDBOX environment https://api-sandbox.oftrust.net/.

  • In PRODUCTION use, change domain in api endpoints to https://api.oftrust.net/

  • To test APIs you need to get needed Bearer Token See Authentication section

If you found a bug or missing information in the documentation, contact us at dev@oftrust.net or create an issue in Github.

Standards used

Dates: we use a subset of ISO-8601 - RFC 3339. Example 2008-09-15T15:53:00+05:00

Core Ontology: The Platform Of Trust core ontology can be found as a JSON-LD ontology from https://standards.oftrust.net/v1/.

Each identity type has their own context which describes the attributes the identity has. The context file name gives a notion of whether the context is for an identity or a link.

The identity describes the real world identities, such as apartments, buildings, rooms etc. The links are the relations between identities. As an example, the Tenant-link can be applied between a user identity and an apartment identity, meaning that the user is a tenant in the apartment.

If only a link between identities is needed, without any kind of role, the generic link-link.jsonld can be used contexts/link-link.jsonld.

Read more from https://standards.oftrust.net/v1/

ACL

Get ACL API related resources:

Version: v1

/acl/v1/{from_identity}/{target_identity}

post

Description: Set permissions. Will give the from identity read, write, link and/or manage access to the to target identity. If any type of privilege (read, write, link or manage) is left out or set to null, then it will remain unchanged.

http request

Do you need help in using the POST /acl/v1/{from_identity}/{target_identity} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: POST /acl/v1/{from_identity}/{target_identity}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "read" : true,
        "write" : true,
        "link" : true,
        "manage" : false
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"read\" : true,
        \"write\" : true,
        \"link\" : true,
        \"manage\" : false
    }" "https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "read" : true,
        "write" : true,
        "link" : true,
        "manage" : false
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    
    
    

    POST /acl/v1/{from_identity}/{target_identity}

    Parameters

    Name Located in Description Required Type
    from_identity path The identity that is granted access to the target_identity Yes string
    target_identity path The identity that can be accessed Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    204
    403
    404

    delete

    Description: Delete permission

    http request

    Do you need help in using the DELETE /acl/v1/{from_identity}/{target_identity} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: DELETE /acl/v1/{from_identity}/{target_identity}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/acl/v1/{from_identity}/{target_identity}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    
    
    

    DELETE /acl/v1/{from_identity}/{target_identity}

    Parameters

    Name Located in Description Required Type
    from_identity path The identity that is granted access to the target_identity Yes string
    target_identity path The identity that can be accessed Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    403
    404

    /acl/v1/{target_identity}

    get

    Description: List permissions on an identity. Will list all identities that can access the identity and what access privileges they have.

    http request

    Example for: GET /acl/v1/{target_identity}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/acl/v1/{target_identity}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/acl/v1/{target_identity}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/acl/v1/{target_identity}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "b32ead1c-2f23-4faa-91f3-e30ae239cc16": {
        "read": true,
        "write": true,
        "link": true,
        "manage": true
      },
      "b32ead1c-2f23-4faa-91f3-e30ae239cc17": {
        "read": true,
        "write": true,
        "link": true,
        "manage": true
      }
    }
    
    
    

    GET /acl/v1/{target_identity}

    Parameters

    Name Located in Description Required Type
    target_identity path The identity for which the permissions should be listed Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    403
    404

    /acl/v1/{target_identity}/{permissions}

    get

    Description: Check specific permissions. Used to check if the requester has specific privilege(s) on an identity. Will return 204 if requester has all requested privileges and 403 if at least one is missing.

    http request

    Do you need help in using the GET /acl/v1/{target_identity}/{permissions} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: GET /acl/v1/{target_identity}/{permissions}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/acl/v1/{target_identity}/{permissions}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/acl/v1/{target_identity}/{permissions}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/acl/v1/{target_identity}/{permissions}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    
    
    

    GET /acl/v1/{target_identity}/{permissions}

    Parameters

    Name Located in Description Required Type
    target_identity path The identity to check if given permissions exist for Yes string
    permissions path A comma separated list of permissions to check Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    403
    404

    /acl/v1/batch/{permissions}

    post

    Description: Batch check specific permissions. Used to check if the requester has specific privilege(s) on a batch of identities. Will return a mapping from identity ID to a boolean; true if the user has all the requested privileges to the identity and false if not.

    http request

    Example for: POST /acl/v1/batch/{permissions}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "targets" : [ "82440763-b208-4eab-bc13-1f2620184ea1", "fed4bd28-fca4-4287-9389-b87dd77b815c", "e45f1815-167f-4348-b194-64cd01b5c52f", "016dfc04-4f4a-499c-a289-7861df876392", "3e0d7600-2a81-4be1-842e-81e14739e52c" ]
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/acl/v1/batch/{permissions}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"targets\" : [ \"82440763-b208-4eab-bc13-1f2620184ea1\", \"fed4bd28-fca4-4287-9389-b87dd77b815c\", \"e45f1815-167f-4348-b194-64cd01b5c52f\", \"016dfc04-4f4a-499c-a289-7861df876392\", \"3e0d7600-2a81-4be1-842e-81e14739e52c\" ]
    }" "https://api-sandbox.oftrust.net/acl/v1/batch/{permissions}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "targets" : [ "82440763-b208-4eab-bc13-1f2620184ea1", "fed4bd28-fca4-4287-9389-b87dd77b815c", "e45f1815-167f-4348-b194-64cd01b5c52f", "016dfc04-4f4a-499c-a289-7861df876392", "3e0d7600-2a81-4be1-842e-81e14739e52c" ]
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/acl/v1/batch/{permissions}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "82440763-b208-4eab-bc13-1f2620184ea1": true,
      "fed4bd28-fca4-4287-9389-b87dd77b815c": false,
      "e45f1815-167f-4348-b194-64cd01b5c52f": true,
      "016dfc04-4f4a-499c-a289-7861df876392": true,
      "3e0d7600-2a81-4be1-842e-81e14739e52c": false
    }
    
    

    POST /acl/v1/batch/{permissions}

    Parameters

    Name Located in Description Required Type
    permissions path A comma separated list of permissions to check Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    403
    404

    Application

    Get Application API related resources:

    The Application API provides means to manage user's applications and perform different operations on them, like refreshing client secrets.

    Version: v1

    /apps/v1

    get

    Description: List all applications where the current user is developer

    http request

    Example for: GET /apps/v1

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/apps/v1',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/apps/v1"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/apps/v1")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://schema.org/",
      "@type": "collection",
      "ItemList": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Identity/Digital/Software/App/",
          "@type": "App",
          "@id": "286042aa-6299-4138-8675-da105dfadefc",
          "data": {
            "name": "Example Application",
            "description": "Application description",
            "privacyPolicyUrl": "http://example.com/privacy.html",
            "webPageUrl": "http://example.com/application.html",
            "iconUrl": "http://example.com/icon.png"
          },
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          },
          "inLinks": [
            {
              "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/DeveloperOf/",
              "@type": "DeveloperOf",
              "@id": "a6101e2d-b19c-4cd5-9767-00aa78986a39",
              "from": "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
              "to": "286042aa-6299-4138-8675-da105dfadefc",
              "data": {},
              "metadata": {
                "createdAt": "2018-12-03T14:33:44",
                "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
                "updatedAt": "2018-12-03T14:33:44",
                "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
              }
            }
          ],
          "outLinks": [
            {
              "@context": "https://standards.lifeengine.io/v1/Context/Link/PublishedOn/",
              "@type": "PublishedOn",
              "@id": "87a5dee9-0a29-40c7-9972-475ef2c47890",
              "from": "286042aa-6299-4138-8675-da105dfadefc",
              "to": "10e28dca-3000-4fc5-8b2f-c21bd1893c9d",
              "data": {},
              "metadata": {
                "createdAt": "2018-12-03T14:33:44",
                "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
                "updatedAt": "2018-12-03T14:33:44",
                "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
              }
            }
          ]
        }
      ]
    }
    
    

    GET /apps/v1

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    403

    post

    Description: Create new application and its associated OAuth Client. NOTE: The clientSecrets is shown only once in plain text, when creating the application. Make sure you save it somewhere. The client secret is used for validating the application.

    http request

    Example for: POST /apps/v1

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "groupId" : "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
        "redirectUris" : "https://example.com/auth-callback",
        "defaultScopes" : "",
        "privacyPolicyUrl" : "http://example.com/privacy.html",
        "name" : "Example Application",
        "webPageUrl" : "http://example.com/application.html",
        "scopes" : "",
        "defaultRedirectUri" : "https://example.com/auth-callback",
        "description" : "Application description",
        "iconUrl" : "http://example.com/icon.png"
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/apps/v1',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"groupId\" : \"bfec43ac-a0ce-4469-a78f-3106cf28b4c9\",
        \"redirectUris\" : \"https://example.com/auth-callback\",
        \"defaultScopes\" : \"\",
        \"privacyPolicyUrl\" : \"http://example.com/privacy.html\",
        \"name\" : \"Example Application\",
        \"webPageUrl\" : \"http://example.com/application.html\",
        \"scopes\" : \"\",
        \"defaultRedirectUri\" : \"https://example.com/auth-callback\",
        \"description\" : \"Application description\",
        \"iconUrl\" : \"http://example.com/icon.png\"
    }" "https://api-sandbox.oftrust.net/apps/v1"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "groupId" : "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
        "redirectUris" : "https://example.com/auth-callback",
        "defaultScopes" : "",
        "privacyPolicyUrl" : "http://example.com/privacy.html",
        "name" : "Example Application",
        "webPageUrl" : "http://example.com/application.html",
        "scopes" : "",
        "defaultRedirectUri" : "https://example.com/auth-callback",
        "description" : "Application description",
        "iconUrl" : "http://example.com/icon.png"
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/apps/v1")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Digital/Software/App/",
      "@type": "App",
      "@id": "6601afe9-85e4-4fe8-a3c9-1329f15493e1",
      "data": {
        "name": "Example Application",
        "description": "Application description",
        "privacyPolicyUrl": "http://example.com/privacy.html",
        "webPageUrl": "http://example.com/application.html",
        "iconUrl": "http://example.com/icon.png"
      },
      "metadata": {
        "createdAt": "2018-12-03T14:33:44",
        "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
        "updatedAt": "2018-12-03T14:33:44",
        "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
      },
      "inLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/DeveloperOf/",
          "@type": "DeveloperOf",
          "@id": "a6101e2d-b19c-4cd5-9767-00aa78986a39",
          "from": "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
          "to": "286042aa-6299-4138-8675-da105dfadefc",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "outLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/PublishedOn/",
          "@type": "PublishedOn",
          "@id": "87a5dee9-0a29-40c7-9972-475ef2c47890",
          "from": "286042aa-6299-4138-8675-da105dfadefc",
          "to": "10e28dca-3000-4fc5-8b2f-c21bd1893c9d",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "client": {
        "clientId": "6601afe9-85e4-4fe8-a3c9-1329f15493e1",
        "clientSecrets": [
          "Sw4gT3I0oUynpeTN6YGfvFPE8SPj5LC1YNIHfFCF25w"
        ],
        "scopes": "",
        "redirectUris": "https://example.com/auth-callback",
        "defaultScopes": "",
        "defaultRedirectUri": "https://example.com/auth-callback"
      },
      "tokens": [
        {
          "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz...T79_KYC4Ds",
          "expires_in": 63072000.0,
          "token_type": "Bearer",
          "refresh_token": "SwGAWsFfT1FZrT92NRJc0MaBp9XrmG"
        },
        {
          "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz...T53_KYC4Ds",
          "expires_in": 63072000.0,
          "token_type": "Bearer",
          "refresh_token": "SwGAWsFfT1FZrT92NRJc0MaBp9XrmG"
        }
      ]
    }
    
    

    POST /apps/v1

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    403
    422

    /apps/v1/{app_id}

    get

    Description: Get application's details

    http request

    Example for: GET /apps/v1/{app_id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/apps/v1/{app_id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/apps/v1/{app_id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/apps/v1/{app_id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Digital/Software/App",
      "@type": "App",
      "@id": "48bb2858-e2fc-42d3-b44e-35f138b4b02d",
      "data": {
        "name": "Example Application"
      },
      "metadata": {
        "createdAt": "2018-12-03T14:33:44",
        "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
        "updatedAt": "2018-12-03T14:33:44",
        "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
      },
      "inLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/DeveloperOf/",
          "@type": "DeveloperOf",
          "@id": "a6101e2d-b19c-4cd5-9767-00aa78986a39",
          "from": "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
          "to": "286042aa-6299-4138-8675-da105dfadefc",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "outLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/PublishedOn/",
          "@type": "PublishedOn",
          "@id": "87a5dee9-0a29-40c7-9972-475ef2c47890",
          "from": "286042aa-6299-4138-8675-da105dfadefc",
          "to": "10e28dca-3000-4fc5-8b2f-c21bd1893c9d",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "client": {
        "clientId": "6601afe9-85e4-4fe8-a3c9-1329f15493e1",
        "clientSecrets": [
          "Sw4gT3I0oUynpeTN6YGfvFPE8SPj5LC1YNIHfFCF25w"
        ],
        "scopes": "",
        "redirectUris": "https://example.com/auth-callback",
        "defaultScopes": "",
        "defaultRedirectUri": "https://example.com/auth-callback"
      },
      "token": {
        "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz...T79_KYC4Ds",
        "expires_in": 63072000,
        "token_type": "Bearer",
        "refresh_token": "SwGAWsFfT1FZrT92NRJc0MaBp9XrmG"
      }
    }
    
    

    GET /apps/v1/{app_id}

    Parameters

    Name Located in Description Required Type
    app_id path App's ID Yes string
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update an application and its client. The client secret will not be touched, as it has its own endpoint

    http request

    Example for: PUT /apps/v1/{app_id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "redirectUris" : "https://example.com/auth-callback",
        "defaultScopes" : "",
        "privacyPolicyUrl" : "http://example.com/privacy.html",
        "name" : "Example Application",
        "webPageUrl" : "http://example.com/application.html",
        "scopes" : "",
        "defaultRedirectUri" : "https://example.com/auth-callback",
        "description" : "Application description",
        "iconUrl" : "http://example.com/icon.png"
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/apps/v1/{app_id}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"redirectUris\" : \"https://example.com/auth-callback\",
        \"defaultScopes\" : \"\",
        \"privacyPolicyUrl\" : \"http://example.com/privacy.html\",
        \"name\" : \"Example Application\",
        \"webPageUrl\" : \"http://example.com/application.html\",
        \"scopes\" : \"\",
        \"defaultRedirectUri\" : \"https://example.com/auth-callback\",
        \"description\" : \"Application description\",
        \"iconUrl\" : \"http://example.com/icon.png\"
    }" "https://api-sandbox.oftrust.net/apps/v1/{app_id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "redirectUris" : "https://example.com/auth-callback",
        "defaultScopes" : "",
        "privacyPolicyUrl" : "http://example.com/privacy.html",
        "name" : "Example Application",
        "webPageUrl" : "http://example.com/application.html",
        "scopes" : "",
        "defaultRedirectUri" : "https://example.com/auth-callback",
        "description" : "Application description",
        "iconUrl" : "http://example.com/icon.png"
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/apps/v1/{app_id}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Digital/Software/App/",
      "@type": "App",
      "@id": "6601afe9-85e4-4fe8-a3c9-1329f15493e1",
      "data": {
        "name": "Example Application",
        "description": "Application description",
        "privacyPolicyUrl": "http://example.com/privacy.html",
        "webPageUrl": "http://example.com/application.html",
        "iconUrl": "http://example.com/icon.png"
      },
      "metadata": {
        "createdAt": "2018-12-03T14:33:44",
        "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
        "updatedAt": "2018-12-03T14:33:44",
        "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
      },
      "inLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/DeveloperOf/",
          "@type": "DeveloperOf",
          "@id": "a6101e2d-b19c-4cd5-9767-00aa78986a39",
          "from": "bfec43ac-a0ce-4469-a78f-3106cf28b4c9",
          "to": "286042aa-6299-4138-8675-da105dfadefc",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "outLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/PublishedOn/",
          "@type": "PublishedOn",
          "@id": "87a5dee9-0a29-40c7-9972-475ef2c47890",
          "from": "286042aa-6299-4138-8675-da105dfadefc",
          "to": "10e28dca-3000-4fc5-8b2f-c21bd1893c9d",
          "data": {},
          "metadata": {
            "createdAt": "2018-12-03T14:33:44",
            "createdBy": "747d0af5-6f06-4309-b2d5-f06677356a9a",
            "updatedAt": "2018-12-03T14:33:44",
            "updatedBy": "747d0af5-6f06-4309-b2d5-f06677356a9a"
          }
        }
      ],
      "client": {
        "clientId": "6601afe9-85e4-4fe8-a3c9-1329f15493e1",
        "scopes": "",
        "redirectUris": "https://example.com/auth-callback",
        "defaultScopes": "",
        "defaultRedirectUri": "https://example.com/auth-callback"
      }
    }
    
    

    PUT /apps/v1/{app_id}

    Parameters

    Name Located in Description Required Type
    app_id path App's ID Yes string
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    403
    404
    422

    delete

    Description: Remove an application

    http request

    Example for: DELETE /apps/v1/{app_id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/apps/v1/{app_id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/apps/v1/{app_id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/apps/v1/{app_id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    
    
    

    DELETE /apps/v1/{app_id}

    Parameters

    Name Located in Description Required Type
    app_id path App's ID Yes string
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404

    /apps/v1/{app_id}/refreshsecret

    post

    Description: Create new client secret for the given application. The system will keep track of the two latest secrets, so when creating a new one, the previous one is still available for use.

    http request

    Do you need help in using the POST /apps/v1/{app_id}/refreshSecret ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: POST /apps/v1/{app_id}/refreshSecret

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/apps/v1/{app_id}/refreshSecret',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/apps/v1/{app_id}/refreshSecret"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .post("https://api-sandbox.oftrust.net/apps/v1/{app_id}/refreshSecret")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "clientSecret": "YK45hcnq1D7fsgrvbHkPrIexetnnbqZGPQBV23oVgsA"
    }
    
    

    POST /apps/v1/{app_id}/refreshSecret

    Parameters

    Name Located in Description Required Type
    app_id path App's ID Yes string
    Authorization header The Authorization header, must be Bearer {{access_token}} Yes string

    Responses

    Code Description
    201
    403
    404

    Broker

    Get Broker API related resources:

    The Broker API provides means to connect a service to a translator that will return desired data from different sources. The data broker does not mangle the data in any way, it only functions as a proxy between services and translators.

    Version: v1

    /broker/v1/fetch-data-product

    post

    Description: Request data from an external service defined by the data product, and product code. The data broker will validate the signature of the payload and when verified, relay the request to the translator registered to the data product. The translator must validate the headers and the signature received from the data broker. The translator will then translate the information fetched from an external source into a standardized format that will be returned to the requester.

    http request

    Example for: POST /broker/v1/fetch-data-product

    import requests
    
    headers={
        "X-Pot-Signature" : "Ioma1gqOVFUBrXiziWS....CLqBG4vFozG3YgzPzillNip0=",
        "X-App-Token" : "eyJ0eXAiOiJJV1QiLcJhbgciOiJSUzI1NiJ9.eyJzY29w...VXs5fff",
        "X-User-Token" : "eyJ0eXAIOijKV1QiLcJGbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf",
        "Content-Type" : "application/json"
    }
    json={
        "timestamp" : "2018-11-01T12:00:00+00:00",
        "productCode" : "product-1",
        "parameters" : {
            "param-1" : "Value",
            "param-2" : "Value"
        }
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/broker/{version}/fetch-data-product',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "X-Pot-Signature: Ioma1gqOVFUBrXiziWS....CLqBG4vFozG3YgzPzillNip0=" \
         -H "X-App-Token: eyJ0eXAiOiJJV1QiLcJhbgciOiJSUzI1NiJ9.eyJzY29w...VXs5fff" \
         -H "X-User-Token: eyJ0eXAIOijKV1QiLcJGbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"timestamp\" : \"2018-11-01T12:00:00+00:00\",
        \"productCode\" : \"product-1\",
        \"parameters\" : {
            \"param-1\" : \"Value\",
            \"param-2\" : \"Value\"
        }
    }" "https://api-sandbox.oftrust.net/broker/{version}/fetch-data-product"
    
    const unirest = require("unirest");
    
    const headers = {
        "X-Pot-Signature" : "Ioma1gqOVFUBrXiziWS....CLqBG4vFozG3YgzPzillNip0=",
        "X-App-Token" : "eyJ0eXAiOiJJV1QiLcJhbgciOiJSUzI1NiJ9.eyJzY29w...VXs5fff",
        "X-User-Token" : "eyJ0eXAIOijKV1QiLcJGbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf",
        "Content-Type" : "application/json"
    };
    const body = {
        "timestamp" : "2018-11-01T12:00:00+00:00",
        "productCode" : "product-1",
        "parameters" : {
            "param-1" : "Value",
            "param-2" : "Value"
        }
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/broker/{version}/fetch-data-product")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "<context url>",
      "data": {
        <response from translator>
      },
      "signature": {
        "type": "<signature type>",
        "created": "<RFC3339>",
        "creator": "<public key URL>",
        "signatureValue": "..."
      }
    }
    
    
    

    POST /broker/v1/fetch-data-product

    Parameters

    Name Located in Description Required Type
    version path Yes string
    X-Pot-Signature header A HMAC-SHA256 signature in base64 encoded format. The signature is created from the request payload and the app's client secret.

    Python example:

    body_string = json.dumps(
    body,
    sort_keys=True,
    indent=None,
    separators=(',', ': ')
    ).strip()

    The keys MUST be sorted, without indentation and separators comma (,) and colon (:) specified.

    Get the digest by passing the app client secret (generated when creating a new app) and the body string to hmac:

    digest =
    hmac.new(client_secret.encode('utf-8'),
    body_string.encode('utf-8'),
    hashlib.sha256).digest()


    Return the digest in base64 encoded format:
    X-Pot-Signature = base64.b64encode(digest).decode()
    Yes string
    X-App-Token header The requesting app's JWT token. The token is generated when the app is created. Yes string
    X-User-Token header The currently logged in user's OAuth bearer token. No string
    body body Yes

    Responses

    Code Description
    200
    422

    Calendar

    Get Calendar API related resources:

    The calendar API provides means to create calendar entries to identities. You can e.g. create an event for a housing company identity, a reservation to a room identity, or just a regular calendar entry to any identity you want.

    The calendar entry requires a "to"-identity, the ID of the identity to which the calendar entry applies to. Specify a type for the entry, e.g. Event, Reservation, CalendarEntry. Give the calendar entry a title, e.g. "Housewarming party", a start date, when the entry starts, and an end date when the entry ends. The dates are in RFC3339 format, and will be saved in UTC time.

    You can specify if an entry repeats, as defined in ISO 8601 repeating intervals. A location can be added as well, if needed, as a string, e.g. "Living room".

    The cc is a list of user IDs to whom the calendar entry can be CC'd to. A notification about the entry will be sent to these users.

    Version: v1

    /calendars/v1

    post

    Description: Create a new calendar entry

    http request

    Example for: POST /calendars/v1

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "repeats" : "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M",
        "startDate" : "2019-04-01T12:00:00+02:00",
        "toIdentity" : "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
        "location" : "Courtyard at Teststreet 12",
        "content" : "April fool's event, held on the courtyard.",
        "title" : "April fool's day festivities.",
        "type" : "Event",
        "endDate" : "2019-04-01T16:00:00+02:00",
        "cc" : [ "323bde80-4cc2-472e-bb77-e6a3e95a1253", "0827e9c3-9664-479f-b0ec-956a35d72e4b" ]
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/calendars/v1',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"repeats\" : \"R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M\",
        \"startDate\" : \"2019-04-01T12:00:00+02:00\",
        \"toIdentity\" : \"0920a84a-1548-4644-b95d-e3f80e1b9ca6\",
        \"location\" : \"Courtyard at Teststreet 12\",
        \"content\" : \"April fool's event, held on the courtyard.\",
        \"title\" : \"April fool's day festivities.\",
        \"type\" : \"Event\",
        \"endDate\" : \"2019-04-01T16:00:00+02:00\",
        \"cc\" : [ \"323bde80-4cc2-472e-bb77-e6a3e95a1253\", \"0827e9c3-9664-479f-b0ec-956a35d72e4b\" ]
    }" "https://api-sandbox.oftrust.net/calendars/v1"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "repeats" : "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M",
        "startDate" : "2019-04-01T12:00:00+02:00",
        "toIdentity" : "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
        "location" : "Courtyard at Teststreet 12",
        "content" : "April fool's event, held on the courtyard.",
        "title" : "April fool's day festivities.",
        "type" : "Event",
        "endDate" : "2019-04-01T16:00:00+02:00",
        "cc" : [ "323bde80-4cc2-472e-bb77-e6a3e95a1253", "0827e9c3-9664-479f-b0ec-956a35d72e4b" ]
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/calendars/v1")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Calendar/",
      "@type": "Calendar",
      "@id": "c9620d09-cd83-476e-91f5-3f3ea730f4b9",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "title": "April's fools day",
      "startDate": "2019-04-01T12:00:00+02:00",
      "endDate": "2019-04-01T16:00:00+02:00",
      "repeats": "R5/2019-04-01T12:00:00+02:00/P1Y",
      "content": "April fool's event, held on the courtyard.",
      "location": "Courtyard at Teststreet 12",
      "cc": [
        "970bf5ef-8ca8-46a1-a4a9-e595ea1b4024",
        "cb40ce78-d3b3-442a-9db7-66f191698b2a"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    

    POST /calendars/v1

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    422

    /calendars/v1/{id}

    get

    Description: Read one calendar by id

    http request

    Example for: GET /calendars/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/calendars/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/calendars/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/calendars/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Calendar/",
      "@type": "Calendar",
      "@id": "c9620d09-cd83-476e-91f5-3f3ea730f4b9",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "title": "April's fools day",
      "startDate": "2019-04-01T12:00:00+02:00",
      "endDate": "2019-04-01T16:00:00+02:00",
      "repeats": "R5/2019-04-01T12:00:00+02:00/P1Y",
      "content": "April fool's event, held on the courtyard.",
      "location": "Courtyard at Teststreet 12",
      "cc": [
        "970bf5ef-8ca8-46a1-a4a9-e595ea1b4024",
        "cb40ce78-d3b3-442a-9db7-66f191698b2a"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    

    GET /calendars/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the calendar Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update a calendar by id

    http request

    Example for: PUT /calendars/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "type" : "Event",
        "title" : "April fool's day festivities.",
        "startDate" : "2019-04-01T12:00:00+02:00",
        "endDate" : "2019-04-01T16:00:00+02:00",
        "repeats" : "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M",
        "content" : "April fool's event, held on the courtyard.",
        "location" : "Courtyard at Teststreet 12"
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/calendars/v1/{id}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"type\" : \"Event\",
        \"title\" : \"April fool's day festivities.\",
        \"startDate\" : \"2019-04-01T12:00:00+02:00\",
        \"endDate\" : \"2019-04-01T16:00:00+02:00\",
        \"repeats\" : \"R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M\",
        \"content\" : \"April fool's event, held on the courtyard.\",
        \"location\" : \"Courtyard at Teststreet 12\"
    }" "https://api-sandbox.oftrust.net/calendars/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "type" : "Event",
        "title" : "April fool's day festivities.",
        "startDate" : "2019-04-01T12:00:00+02:00",
        "endDate" : "2019-04-01T16:00:00+02:00",
        "repeats" : "R5/2008-03-01T13:00:00Z/P1Y2M10DT2H30M",
        "content" : "April fool's event, held on the courtyard.",
        "location" : "Courtyard at Teststreet 12"
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/calendars/v1/{id}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Calendar/",
      "@type": "Calendar",
      "@id": "c9620d09-cd83-476e-91f5-3f3ea730f4b9",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "title": "April's fools day",
      "startDate": "2019-04-01T12:00:00+02:00",
      "endDate": "2019-04-01T16:00:00+02:00",
      "repeats": "R5/2019-04-01T12:00:00+02:00/P1Y",
      "content": "April fool's event, held on the courtyard.",
      "location": "Courtyard at Teststreet 12",
      "cc": [
        "970bf5ef-8ca8-46a1-a4a9-e595ea1b4024",
        "cb40ce78-d3b3-442a-9db7-66f191698b2a"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    

    PUT /calendars/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the calendar Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    404
    422

    delete

    Description: Delete a calendar by id

    http request

    Example for: DELETE /calendars/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/calendars/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/calendars/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/calendars/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    {}
    
    

    DELETE /calendars/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the calendar Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404

    /calendars/v1/{toidentity}/list

    get

    Description: List calendars created for "to"-identity.

    http request

    Do you need help in using the GET /calendars/v1/{toIdentity}/list ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: GET /calendars/v1/{toIdentity}/list

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/calendars/v1/{toIdentity}/list',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/calendars/v1/{toIdentity}/list"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/calendars/v1/{toIdentity}/list")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://schema.org/",
      "@type": "collection",
      "ItemList": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Calendar/",
          "@type": "Calendar",
          "@id": "c9620d09-cd83-476e-91f5-3f3ea730f4b9",
          "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
          "title": "April's fools day",
          "startDate": "2019-04-01T12:00:00+02:00",
          "endDate": "2019-04-01T16:00:00+02:00",
          "repeats": "R5/2019-04-01T12:00:00+02:00/P1Y",
          "content": "April fool's event, held on the courtyard.",
          "location": "Courtyard at Teststreet 12",
          "cc": [
            "970bf5ef-8ca8-46a1-a4a9-e595ea1b4024",
            "cb40ce78-d3b3-442a-9db7-66f191698b2a"
          ],
          "createdAt": "2019-01-10T12:00:00Z",
          "updatedAt": "2019-01-10T12:00:00Z",
          "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
        },
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Calendar/",
          "@type": "Calendar",
          "@id": "c8a3f324-a6cf-44fc-b010-5dd1354ecb89",
          "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
          "title": "May day lunch",
          "startDate": "2019-05-01T12:00:00+02:00",
          "endDate": "2019-05-01T16:00:00+02:00",
          "repeats": "R5/2019-05-01T12:00:00+02:00/P1Y",
          "content": "May day lunch at restaurant",
          "location": "Courtyard at Teststreet 12",
          "cc": [
            "970bf5ef-8ca8-46a1-a4a9-e595ea1b4024",
            "cb40ce78-d3b3-442a-9db7-66f191698b2a"
          ],
          "createdAt": "2019-01-10T12:00:00Z",
          "updatedAt": "2019-01-10T12:00:00Z",
          "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
        }
      ]
    }
    
    
    

    GET /calendars/v1/{toIdentity}/list

    Parameters

    Name Located in Description Required Type
    toIdentity path The identity to which the calendar belongs to. Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200

    Context

    Get Context API related resources:

    The Context API provides means to list available JSON-LD contexts of the Platform of Trust.

    The contexts defines the semantic meaning of the keys in the responses from the APIs. When creating a new identity, choose which type of identity to create by choosing the correct context. The context will then define the attributes the identity can have.

    Version: v1

    /contexts/v1/

    get

    Description: List all supported contexts

    http request

    Example for: GET /contexts/v1/

    import requests
    
    
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/contexts/v1/',
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET "https://api-sandbox.oftrust.net/contexts/v1/"
    
    const unirest = require("unirest");
    
    
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/contexts/v1/")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "standards": {
        "Core": {
          "dataProducts": [
            {
              "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/DataProduct",
              "context": "https://standards.oftrust.net/v1/Context/DataProduct",
              "name": "Data Product",
              "subclasses": [],
              "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/DataProduct"
            }
          ],
          "identities": [],
          "links": [
            {
              "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/Link",
              "context": "https://standards.oftrust.net/v1/Context/Link",
              "name": "Link",
              "subclasses": [
                {
                  "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/Link/Role",
                  "context": "https://standards.oftrust.net/v1/Context/Link/Role",
                  "name": "Role",
                  "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/Link/Role",
                  "subclasses": []
                }
              ],
              "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/Link"
            }
          ]
        },
        "Platform of Trust": {
          "dataProducts": [],
          "identities": [
            {
              "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/Group/Organization",
              "context": "https://standards.oftrust.net/v1/Context/Group/Organization",
              "name": "Organization",
              "subclasses": [
                {
                  "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/Group/Organization/LimitedCompany",
                  "context": "https://standards.oftrust.net/v1/Context/Group/Organization/LimitedCompany",
                  "name": "Limited Company",
                  "subclasses": [
                    {
                      "classDefinition": "https://standards.oftrust.net/v1/ClassDefinitions/Group/Organization/LimitedCompany/HousingCooperative",
                      "context": "https://standards.oftrust.net/v1/Context/Group/Organization/LimitedCompany/HousingCooperative",
                      "name": "Housing Cooperative",
                      "subclasses": [],
                      "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/Group/Organization/LimitedCompany/HousingCooperative"
                    }
                  ],
                  "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/Group/Organization/LimitedCompany"
                }
              ],
              "vocabulary": "https://standards.oftrust.net/v1/Vocabulary/Group/Organization"
            }
          ],
          "links": []
        }
      }
    }
    
    
    
    

    GET /contexts/v1/

    Responses

    Code Description
    200

    Identity

    Get Identity API related resources:

    The Identity API provides means to create, update and delete digital twins (identities) and manage links between them. The links provides the direction and type (sometimes called role) of the link.

    Version: v1

    /identities/v1

    post

    Description: Create a new identity

    http request

    Example for: POST /identities/v1

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "context" : "https://standards.lifeengine.io/v1/Context/Identity/Group/",
        "type" : "Group",
        "data" : {
            "name" : "Company Oy"
        }
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/identities/v1',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    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"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "context" : "https://standards.lifeengine.io/v1/Context/Identity/Group/",
        "type" : "Group",
        "data" : {
            "name" : "Company Oy"
        }
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/identities/v1")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Group/",
      "@type": "Group",
      "@id": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "data": {
        "name": "Company Oy"
      },
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      },
      "inLinks": [],
      "outLinks": []
    }
    
    
    

    POST /identities/v1

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    422

    /identities/v1/{id}

    get

    Description: Read one identity by id. Requires the read permission on the identity.

    http request

    Example for: GET /identities/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/identities/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/identities/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Group/",
      "@type": "Group",
      "@id": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "data": {
        "name": "Company Oy"
      },
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      },
      "inLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        }
      ],
      "outLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cb40ce78-d3b3-442a-9db7-66f191698b2a",
          "from": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "to": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        }
      ]
    }
    
    
    

    GET /identities/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the Identity Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update an identity by id. Requires the write permission on the identity.

    http request

    Example for: PUT /identities/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "context" : "https://standards.lifeengine.io/v1/Context/Identity/Group/",
        "type" : "Group",
        "data" : {
            "name" : "Company Oy"
        }
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/identities/v1/{id}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -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/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "context" : "https://standards.lifeengine.io/v1/Context/Identity/Group/",
        "type" : "Group",
        "data" : {
            "name" : "Company Oy"
        }
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/identities/v1/{id}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Group/",
      "@type": "Group",
      "@id": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "data": {
        "name": "Company Oy"
      },
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      },
      "inLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        }
      ],
      "outLinks": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cb40ce78-d3b3-442a-9db7-66f191698b2a",
          "from": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "to": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        }
      ]
    }
    
    
    

    PUT /identities/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the Identity Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    404
    422

    delete

    Description: Delete an identity by id. Requires the manage permission on the identity.

    http request

    Example for: DELETE /identities/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/identities/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/identities/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    {}
    
    

    DELETE /identities/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the Identity Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404
    422

    post

    Description: Creates a new link between two identities

    http request

    Do you need help in using the POST /identities/v1/{from_identity}/link/{to_identity} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: POST /identities/v1/{from_identity}/link/{to_identity}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "context" : "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
        "type" : "MemberOf"
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"context\" : \"https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/\",
        \"type\" : \"MemberOf\"
    }" "https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "context" : "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
        "type" : "MemberOf"
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
      "@type": "MemberOf",
      "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "data": {},
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      }
    }
    
    
    

    POST /identities/v1/{from_identity}/link/{to_identity}

    Parameters

    Name Located in Description Required Type
    from_identity path The starting identity ID of the link Yes string
    to_identity path The ending identity ID of the link Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    404
    422

    get

    Description: Read a link by type

    http request

    Do you need help in using the GET /identities/v1/{from_identity}/link/{to_identity}/{type} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: GET /identities/v1/{from_identity}/link/{to_identity}/{type}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
      "@type": "MemberOf",
      "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "data": {},
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      }
    }
    
    
    

    GET /identities/v1/{from_identity}/link/{to_identity}/{type}

    Parameters

    Name Located in Description Required Type
    type path The @type of the link, for example Link, Tenant or Owner Yes string
    from_identity path The starting identity ID of the link Yes string
    to_identity path The ending identity ID of the link Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update a link

    http request

    Do you need help in using the PUT /identities/v1/{from_identity}/link/{to_identity}/{type} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: PUT /identities/v1/{from_identity}/link/{to_identity}/{type}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "context" : "https://example.com/contexts/type.jsonld",
        "type" : "Owner"
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"context\" : \"https://example.com/contexts/type.jsonld\",
        \"type\" : \"Owner\"
    }" "https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "context" : "https://example.com/contexts/type.jsonld",
        "type" : "Owner"
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
      "@type": "MemberOf",
      "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
      "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
      "data": {},
      "metadata": {
        "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
        "createdAt": "2018-02-28T16:41:41.090Z",
        "updatedAt": "2018-02-28T16:41:41.090Z"
      }
    }
    
    
    

    PUT /identities/v1/{from_identity}/link/{to_identity}/{type}

    Parameters

    Name Located in Description Required Type
    type path The @type of the link, for example Link, Tenant or Owner Yes string
    from_identity path The starting identity ID of the link Yes string
    to_identity path The ending identity ID of the link Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    404
    422

    delete

    Description: Delete a link by type

    http request

    Do you need help in using the DELETE /identities/v1/{from_identity}/link/{to_identity}/{type} ?

  • Checkout existing questions & answers
  • Ask a question in Stack Overflow

  • Did we miss something? Make a wish!
  •  

    Example for: DELETE /identities/v1/{from_identity}/link/{to_identity}/{type}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/identities/v1/{from_identity}/link/{to_identity}/{type}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    {}
    
    

    DELETE /identities/v1/{from_identity}/link/{to_identity}/{type}

    Parameters

    Name Located in Description Required Type
    type path The @type of the link, for example Link, Tenant or Owner Yes string
    from_identity path The starting identity ID of the link Yes string
    to_identity path The ending identity ID of the link Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404
    422

    get

    Description: List outbound links for a given identity

    http request

    Example for: GET /identities/v1/{id}/links

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/identities/v1/{id}/links',
        params='type=%2Fidentities%2F%7Bversion%7D%2F%7Bid%7D%2Flinks%3Ftype%3DOwner',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/{id}/links?type=%2Fidentities%2F%7Bversion%7D%2F%7Bid%7D%2Flinks%3Ftype%3DOwner"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/identities/v1/{id}/links")
      .headers(headers)
      .query("type=%2Fidentities%2F%7Bversion%7D%2F%7Bid%7D%2Flinks%3Ftype%3DOwner")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://schema.org/",
      "@type": "collection",
      "ItemList": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        },
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Link/Role/MemberOf/",
          "@type": "MemberOf",
          "@id": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "from": "58dc29ab-d52e-4aab-a228-9b54e001797c",
          "to": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
          "data": {},
          "metadata": {
            "createdBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "updatedBy": "cf0862f6-3f4f-498f-97f1-fbe8b5734448",
            "createdAt": "2018-02-28T16:41:41.090Z",
            "updatedAt": "2018-02-28T16:41:41.090Z"
          }
        }
      ]
    }
    
    
    

    GET /identities/v1/{id}/links

    Parameters

    Name Located in Description Required Type
    id path The ID of the identity Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    type query If given to GET /identities/v1/{id}/links?type=Owner, will list only the links of @type: "Owner" No string

    Responses

    Code Description
    200
    404

    /identities/v1/discovery

    get

    Description: Discover identities in the identity network.

    http request

    Example for: GET /identities/v1/discovery

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/identities/v1/discovery',
        params='fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/discovery?fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/identities/v1/discovery")
      .headers(headers)
      .query("fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "identities": {
        "eccbcc62-37e2-4014-8233-d077fce7bac9": {
          "@context": "https://standards.oftrust.net/v1/Context/Identity/Device/Sensor/TemperatureSensor/",
          "@type": "TemperatureSensor",
          "@id": "eccbcc62-37e2-4014-8233-d077fce7bac9",
          "data": {
            "name": "Temperature sensor",
            "codeLocal": "local code"
          },
          "metadata": {
            "createdAt": "2019-09-17T12:53:25+00:00",
            "createdBy": "f773dafe-20c0-4a25-aa3e-9da0b81b9304",
            "updatedAt": "2019-09-17T12:53:25+00:00",
            "updatedBy": "f773dafe-20c0-4a25-aa3e-9da0b81b9304"
          }
        }
      },
      "pagination": {
        "links": [
          {
            "rel": "first",
            "href": "https://api-sandbox.oftrust.net/identities/v1/discovery?offset=0&limit=1&fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3"
          },
          {
            "rel": "self",
            "href": "https://api-sandbox.oftrust.net/identities/v1/discovery?fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3&offset=0&limit=1"
          },
          {
            "rel": "last",
            "href": "https://api-sandbox.oftrust.net/identities/v1/discovery?offset=173&limit=1&fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3"
          },
          {
            "rel": "next",
            "href": "https://api-sandbox.oftrust.net/identities/v1/discovery?offset=1&limit=1&fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3"
          }
        ],
        "hasMore": true,
        "totalCount": 174
      }
    }
    
    
    

    GET /identities/v1/discovery

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    fromId query The starting identity to traverse from, e.g. the Building ID. Yes string
    linkContext query The link context to traverse. The context MUST end with a forward slash /. Yes string
    identityContext query The identity context to search for. The context MUST end with a forward slash /. Yes string
    linkDirection query The direction to traverse from the building, one of "IN" or "OUT". When using "IN" it means that the BelongsTo links are incoming links towards the Building: (Building) <-- BelongsTo -- (Storey) When using "OUT" it means that the BelongsTo links are outgoing from the Building (please note that this is just an example, the data model for buildings and storeys are IN): (Building) -- BelongsTo --> (Storey) Yes string
    maxDepth query The traversal max depth. This means that e.g. maxDepth=3 does three link hops in the traversal: (Building) <-- BelongsTo -- (Storey) <-- BelongsTo -- (Room) <-- BelongsTo -- (Sensor) If searching for Sensors but given maxDepth of 2, nothing will be returned since there are 3 links between the building and sensors. This value must be between 1 and 5, but defaults to 2. Yes integer
    offset query The offset used for pagination. Defaults to 0, meaning starting from the first record. Given an offset of 10 means that the next 10 records are returned. Yes integer
    limit query How many records to return, used for pagination. Defaults to 20 records. Given a limit of 100 will return 100 records. This value must be between 1 and 100. Yes integer

    Responses

    Code Description
    200
    403
    404
    422
    500

    /identities/v1/datadiscovery

    get

    Description: Discover data products in the identity network.

    http request

    Example for: GET /identities/v1/dataDiscovery

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/identities/v1/dataDiscovery',
        params='fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/identities/v1/dataDiscovery?fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/identities/v1/dataDiscovery")
      .headers(headers)
      .query("fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=2&offset=10&limit=20")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "dataProducts": {
        "data-product-product-code": {
          "eccbcc62-37e2-4014-8233-d077fce7bac9": "sensor id 1",
          "958f5881-ee48-4a5a-a6ed-bad100ec72ac": "sensor id 2"
        }
      },
      "pagination": {
        "links": [
          {
            "rel": "first",
            "href": "https://api-sandbox.oftrust.net/identities/v1/dataDiscovery?offset=0&limit=10&fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3"
          },
          {
            "rel": "self",
            "href": "https://api-sandbox.oftrust.net/identities/v1/dataDiscovery?fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3&offset=0&limit=10"
          },
          {
            "rel": "last",
            "href": "https://api-sandbox.oftrust.net/identities/v1/dataDiscovery?offset=0&limit=10&fromId=fc3bced4-a132-4293-9240-4d0f02277e2e&linkContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FLink%2FBelongsTo%2F&identityContext=https%3A%2F%2Fstandards.oftrust.net%2Fv1%2FContext%2FIdentity%2FDevice%2FSensor%2F&linkDirection=IN&maxDepth=3"
          }
        ],
        "hasMore": false,
        "totalCount": 2
      }
    }
    
    
    

    GET /identities/v1/dataDiscovery

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    fromId query The starting identity to traverse from, e.g. the Building ID. Yes string
    linkContext query The link context to traverse. The context MUST end with a forward slash /. type: string example: https://standards.oftrust.net/v1/Context/Link/BelongsTo/ Yes string
    identityContext query The identity context to search for. The context MUST end with a forward slash /. Yes string
    linkDirection query The direction to traverse from the building, one of "IN" or "OUT". When using "IN" it means that the BelongsTo links are incoming links towards the Building: (Building) <-- BelongsTo -- (Storey) When using "OUT" it means that the BelongsTo links are outgoing from the Building (please note that this is just an example, the data model for buildings and storeys are IN): (Building) -- BelongsTo --> (Storey) Yes string
    maxDepth query The traversal max depth. This means that e.g. maxDepth=3 does three link hops in the traversal: (Building) <-- BelongsTo -- (Storey) <-- BelongsTo -- (Room) <-- BelongsTo -- (Sensor) If searching for Sensors but given maxDepth of 2, nothing will be returned since there are 3 links between the building and sensors. This value must be between 1 and 5, but defaults to 2. Yes integer
    offset query The offset used for pagination. Defaults to 0, meaning starting from the first record. Given an offset of 10 means that the next 10 records are returned. Yes integer
    limit query How many records to return, used for pagination. Defaults to 20 records. Given a limit of 100 will return 100 records. This value must be between 1 and 100. Yes integer

    Responses

    Code Description
    200
    404
    422
    500

    Login

    Get Login API related resources:

    Version: v1

    /exchangetoken

    post

    Description: Authorization flow, convert authorization code to access token.

    http request

    POST /exchangeToken

    Parameters

    Name Located in Description Required Type
    type header Yes string
    example header Yes string
    grant_type formData The grant type of the login, MUST be authorization_code. Yes string
    redirect_uri formData The redirect URI used in the authorization flow. Yes string
    code formData The authorization code to exchange to an access token. Yes string
    client_secret formData The authorization code to exchange to an access token. Yes string
    state formData The optional state, e.g. CSRF token from the original request. No string

    Responses

    Code Description
    200
    400
    401 If e.g. the authorization code has expired.
    422

    /me

    get

    Description: Get information about the currently logged in user.

    http request

    GET /me

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    403

    /acl/{fromidentity}/{targetidentity}

    post

    Description: Set permissions. Will give the from identity read, write, link and/or manage access to the to target identity. If any type of privilege (read, write, link or manage) is left out or set to null, then it will remain unchanged.

    http request

    POST /acl/{fromIdentity}/{targetIdentity}

    Parameters

    Name Located in Description Required Type
    fromIdentity path The identity that is granted access to the targetIdentity Yes string
    targetIdentity path The identity that can be accessed Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    204
    403
    404

    Message

    Get Message API related resources:

    The message API provides means to create/send messages to identities. You can send a message to any identity, e.g. a housing company, where all users who has access to the housing company identity and its messages can read the message.

    The message requires a "to"-identity, the ID of the identity to which the message applies to. A message subject and its content should be added as well.

    The cc is a list of user IDs to whom the message can be CC'd to. A notification about the message will be sent to these users.

    Version: v1

    /messages/v1

    post

    Description: Create a new message

    http request

    Example for: POST /messages/v1

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "toIdentity" : "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
        "subject" : "Go to the grocery store",
        "content" : "Remember to buy milk!",
        "cc" : [ "323bde80-4cc2-472e-bb77-e6a3e95a1253", "0827e9c3-9664-479f-b0ec-956a35d72e4b" ]
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/messages/v1',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"toIdentity\" : \"0920a84a-1548-4644-b95d-e3f80e1b9ca6\",
        \"subject\" : \"Go to the grocery store\",
        \"content\" : \"Remember to buy milk!\",
        \"cc\" : [ \"323bde80-4cc2-472e-bb77-e6a3e95a1253\", \"0827e9c3-9664-479f-b0ec-956a35d72e4b\" ]
    }" "https://api-sandbox.oftrust.net/messages/v1"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "toIdentity" : "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
        "subject" : "Go to the grocery store",
        "content" : "Remember to buy milk!",
        "cc" : [ "323bde80-4cc2-472e-bb77-e6a3e95a1253", "0827e9c3-9664-479f-b0ec-956a35d72e4b" ]
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/messages/v1")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Message/",
      "@type": "Message",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "subject": "Go to the grocery store",
      "content": "Remember to buy milk!",
      "cc": [
        "323bde80-4cc2-472e-bb77-e6a3e95a1253",
        "0827e9c3-9664-479f-b0ec-956a35d72e4b"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    
    

    POST /messages/v1

    Parameters

    Name Located in Description Required Type
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    422

    /messages/v1/{id}

    get

    Description: Read one message by id

    http request

    Example for: GET /messages/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/messages/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/messages/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/messages/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Message/",
      "@type": "Message",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "subject": "Go to the grocery store",
      "content": "Remember to buy milk!",
      "cc": [
        "323bde80-4cc2-472e-bb77-e6a3e95a1253",
        "0827e9c3-9664-479f-b0ec-956a35d72e4b"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    
    

    GET /messages/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the message Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update a message by id

    http request

    Example for: PUT /messages/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    }
    json={
        "subject" : "Go to the grocery store",
        "content" : "Remember to buy milk!"
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/messages/v1/{id}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -H "Authorization: Bearer <ACCESS_TOKEN>" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"subject\" : \"Go to the grocery store\",
        \"content\" : \"Remember to buy milk!\"
    }" "https://api-sandbox.oftrust.net/messages/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>",
        "Content-Type" : "application/json"
    };
    const body = {
        "subject" : "Go to the grocery store",
        "content" : "Remember to buy milk!"
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/messages/v1/{id}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Message/",
      "@type": "Message",
      "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
      "subject": "Go to the grocery store",
      "content": "Remember to buy milk!",
      "cc": [
        "323bde80-4cc2-472e-bb77-e6a3e95a1253",
        "0827e9c3-9664-479f-b0ec-956a35d72e4b"
      ],
      "createdAt": "2019-01-10T12:00:00Z",
      "updatedAt": "2019-01-10T12:00:00Z",
      "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
    }
    
    
    

    PUT /messages/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the message Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    404
    422

    delete

    Description: Delete a message by id

    http request

    Example for: DELETE /messages/v1/{id}

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/messages/v1/{id}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/messages/v1/{id}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/messages/v1/{id}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    {}
    
    

    DELETE /messages/v1/{id}

    Parameters

    Name Located in Description Required Type
    id path The ID of the message Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404

    /messages/v1/{id}/read

    post

    Description: Marks a message read by the currently logged in user.

    http request

    Example for: POST /messages/v1/{id}/read

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/messages/v1/{id}/read',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/messages/v1/{id}/read"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .post("https://api-sandbox.oftrust.net/messages/v1/{id}/read")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {}
    
    

    POST /messages/v1/{id}/read

    Parameters

    Name Located in Description Required Type
    id path The ID of the message Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200
    403

    /messages/v1/{toidentity}/list

    get

    Description: List messages sent to "to"-identity.

    http request

    Example for: GET /messages/v1/{toIdentity}/list

    import requests
    
    headers={
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    }
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/messages/v1/{toIdentity}/list',
        headers=headers,
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET \
         -H "Authorization: Bearer <ACCESS_TOKEN>" "https://api-sandbox.oftrust.net/messages/v1/{toIdentity}/list"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer <ACCESS_TOKEN>"
    };
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/messages/v1/{toIdentity}/list")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://schema.org/",
      "@type": "collection",
      "ItemList": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Message/",
          "@type": "Message",
          "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
          "subject": "Go to the grocery store",
          "content": "Remember to buy milk!",
          "cc": [
            "323bde80-4cc2-472e-bb77-e6a3e95a1253",
            "0827e9c3-9664-479f-b0ec-956a35d72e4b"
          ],
          "createdAt": "2019-01-10T12:00:00Z",
          "updatedAt": "2019-01-10T12:00:00Z",
          "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
        },
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Message/",
          "@type": "Message",
          "toIdentity": "0920a84a-1548-4644-b95d-e3f80e1b9ca6",
          "subject": "You forgot the milk",
          "content": "...",
          "cc": [
            "323bde80-4cc2-472e-bb77-e6a3e95a1253",
            "0827e9c3-9664-479f-b0ec-956a35d72e4b"
          ],
          "createdAt": "2019-01-10T12:00:00Z",
          "updatedAt": "2019-01-10T12:00:00Z",
          "createdBy": "58422496-5796-4c47-a4a1-88768ea94ea6"
        }
      ]
    }
    
    
    

    GET /messages/v1/{toIdentity}/list

    Parameters

    Name Located in Description Required Type
    toIdentity path The identity to which the message belongs to. Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    200

    Product

    Get Product API related resources:

    The Product API provides means to manage products provided by PoT core. The product defines the URL to the translator, as well as a product code to use when requesting data from the translator. Note that when creating a new data product, the developer who creates it MUST belong to a group (organization), and POST that group ID in the request when creating the data product.

    Version: v1

    /products/v1

    post

    Description: Create a new product

    http request

    Example for: POST /products/v1

    import requests
    
    headers={
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN",
        "Content-Type" : "application/json"
    }
    json={
        "groupId" : "0a52c776-1c9c-42b1-ac03-b64c04abded2",
        "imageUrl" : "https://example.com/product-image.png",
        "name" : "Product name",
        "translatorUrl" : "https://example.com/translator",
        "organizationPublicKeys" : [ {
            "url" : "https://example.com/public-key.pub",
            "type" : "RsaSignature2018"
        }, {
            "url" : "https://example.com/public-key-2.pub",
            "type" : "RsaSignature2018"
        } ],
        "dataContext" : "https://example.com/v1/Context/Data",
        "productCode" : "product-1",
        "description" : "This is a product that returns the temperature data for ...",
        "parameterContext" : "https://example.com/v1/Context/Parameter"
    }
    
    response = requests.post(
        'https://api-sandbox.oftrust.net/products/{version}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X POST \
         -H "Authorization: Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"groupId\" : \"0a52c776-1c9c-42b1-ac03-b64c04abded2\",
        \"imageUrl\" : \"https://example.com/product-image.png\",
        \"name\" : \"Product name\",
        \"translatorUrl\" : \"https://example.com/translator\",
        \"organizationPublicKeys\" : [ {
            \"url\" : \"https://example.com/public-key.pub\",
            \"type\" : \"RsaSignature2018\"
        }, {
            \"url\" : \"https://example.com/public-key-2.pub\",
            \"type\" : \"RsaSignature2018\"
        } ],
        \"dataContext\" : \"https://example.com/v1/Context/Data\",
        \"productCode\" : \"product-1\",
        \"description\" : \"This is a product that returns the temperature data for ...\",
        \"parameterContext\" : \"https://example.com/v1/Context/Parameter\"
    }" "https://api-sandbox.oftrust.net/products/{version}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN",
        "Content-Type" : "application/json"
    };
    const body = {
        "groupId" : "0a52c776-1c9c-42b1-ac03-b64c04abded2",
        "imageUrl" : "https://example.com/product-image.png",
        "name" : "Product name",
        "translatorUrl" : "https://example.com/translator",
        "organizationPublicKeys" : [ {
            "url" : "https://example.com/public-key.pub",
            "type" : "RsaSignature2018"
        }, {
            "url" : "https://example.com/public-key-2.pub",
            "type" : "RsaSignature2018"
        } ],
        "dataContext" : "https://example.com/v1/Context/Data",
        "productCode" : "product-1",
        "description" : "This is a product that returns the temperature data for ...",
        "parameterContext" : "https://example.com/v1/Context/Parameter"
    };
    
    unirest
      .post("https://api-sandbox.oftrust.net/products/{version}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 201
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Thing/HumanWorld/Product/DataProduct",
      "@type": "DataProduct",
      "@id": "https://api-sandbox.oftrust.net/products/v1/product-1",
      "productCode": "product-1",
      "dataContext": "https://example.com/v1/Context/Data",
      "parameterContext": "https://example.com/v1/Context/Parameter",
      "translatorUrl": "https://translator.example.com/fetch-data-product",
      "name": "Product name",
      "organizationPublicKeys": [
        {
          "url": "https://example.com/public-key.pub",
          "type": "RsaSignature2018"
        },
        {
          "url": "https://example.com/public-key-2.pub",
          "type": "RsaSignature2018"
        }
      ],
      "description": "This is a product that returns the temperature data for ...",
      "imageUrl": "https://example.com/product-image.png",
      "identityId": "31b5b971-dc50-4c9c-992a-57c0bf016186"
    }
    
    

    POST /products/v1

    Parameters

    Name Located in Description Required Type
    version path Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    201
    422

    get

    Description: Lists all available products. NOTE: This is a CORS enabled endpoint. Supports pagination.

    http request

    Example for: GET /products/v1

    import requests
    
    
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/products/{version}',
        params='offset=200&limit=400',
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET "https://api-sandbox.oftrust.net/products/{version}?offset=200&limit=400"
    
    const unirest = require("unirest");
    
    
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/products/{version}")
      .query("offset=200&limit=400")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://schema.org/",
      "@type": "collection",
      "ItemList": [
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Identity/Thing/HumanWorld/Product/DataProduct",
          "@type": "DataProduct",
          "@id": "https://api-sandbox.oftrust.net/products/v1/product-1",
          "productCode": "product-1",
          "dataContext": "https://example.com/v1/Context/Data",
          "parameterContext": "https://example.com/v1/Context/Parameter",
          "translatorUrl": "https://translator.example.com/fetch-data-product",
          "name": "Product name",
          "organizationPublicKeys": [
            {
              "url": "https://example.com/public-key.pub",
              "type": "RsaSignature2018"
            },
            {
              "url": "https://example.com/public-key-2.pub",
              "type": "RsaSignature2018"
            }
          ],
          "description": "This is a product that returns the temperature data for ...",
          "imageUrl": "https://example.com/product-image.png",
          "identityId": "31b5b971-dc50-4c9c-992a-57c0bf016186"
        },
        {
          "@context": "https://standards.lifeengine.io/v1/Context/Identity/Thing/HumanWorld/Product/DataProduct",
          "@type": "DataProduct",
          "@id": "https://api-sandbox.oftrust.net/products/v1/product-2",
          "productCode": "product-2",
          "dataContext": "https://example.com/v1/Context/Data",
          "parameterContext": "https://example.com/v1/Context/Parameter",
          "translatorUrl": "https://translator.example.com/fetch",
          "name": "Product name example",
          "organizationPublicKeys": [
            {
              "url": "https://example.com/public-key.pub",
              "type": "RsaSignature2018"
            },
            {
              "url": "https://example.com/public-key-2.pub",
              "type": "RsaSignature2018"
            }
          ],
          "description": "This is a product that returns the maintenance history data for ...",
          "imageUrl": "https://example.com/product-image.png",
          "identityId": "f4902768-39aa-492d-9d4f-99b5cf13ee2b"
        }
      ],
      "pagination": {
        "links": [
          {
            "rel": "first",
            "href": "<API URL>/products?offset=0&limit=2"
          },
          {
            "rel": "self",
            "href": "<API URL>/products"
          },
          {
            "rel": "last",
            "href": "<API URL>/products?offset=2&limit=2"
          },
          {
            "rel": "next",
            "href": "<API URL>/products?offset=2&limit=2"
          }
        ],
        "hasMore": true,
        "totalCount": 10
      }
    }
    
    

    GET /products/v1

    Parameters

    Name Located in Description Required Type
    version path Yes string
    offset query Offset of a query No integer
    limit query Limit the result of a query No integer

    Responses

    Code Description
    200

    /products/v1/{product_code}

    get

    Description: Reads a single product by product code. NOTE: This is a CORS enabled endpoint.

    http request

    Example for: GET /products/v1/{product_code}

    import requests
    
    
    
    
    response = requests.get(
        'https://api-sandbox.oftrust.net/products/{version}/{product_code}',
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X GET "https://api-sandbox.oftrust.net/products/{version}/{product_code}"
    
    const unirest = require("unirest");
    
    
    
    
    unirest
      .get("https://api-sandbox.oftrust.net/products/{version}/{product_code}")
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Thing/HumanWorld/Product/DataProduct",
      "@type": "DataProduct",
      "@id": "https://api-sandbox.oftrust.net/products/v1/product-1",
      "productCode": "product-1",
      "dataContext": "https://example.com/v1/Context/Data",
      "parameterContext": "https://example.com/v1/Context/Parameter",
      "translatorUrl": "https://translator.example.com/fetch-data-product",
      "name": "Product name",
      "organizationPublicKeys": [
        {
          "url": "https://example.com/public-key.pub",
          "type": "RsaSignature2018"
        },
        {
          "url": "https://example.com/public-key-2.pub",
          "type": "RsaSignature2018"
        }
      ],
      "description": "This is a product that returns the temperature data for ...",
      "imageUrl": "https://example.com/product-image.png",
      "identityId": "31b5b971-dc50-4c9c-992a-57c0bf016186"
    }
    
    

    GET /products/v1/{product_code}

    Parameters

    Name Located in Description Required Type
    product_code path The product code of the product. Yes string
    version path Yes string

    Responses

    Code Description
    200
    404

    put

    Description: Update a product by product code

    http request

    Example for: PUT /products/v1/{product_code}

    import requests
    
    headers={
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN",
        "Content-Type" : "application/json"
    }
    json={
        "dataContext" : "https://example.com/v1/Context/Data",
        "parameterContext" : "https://example.com/v1/Context/Parameter",
        "productCode" : "product-1",
        "name" : "Product name",
        "translatorUrl" : "https://example.com/translator",
        "organizationPublicKeys" : [ {
            "url" : "https://example.com/public-key.pub",
            "type" : "RsaSignature2018"
        }, {
            "url" : "https://example.com/public-key-2.pub",
            "type" : "RsaSignature2018"
        } ],
        "imageUrl" : "https://example.com/product-image.png",
        "description" : "This is a product that returns the temperature data for ..."
    }
    
    response = requests.put(
        'https://api-sandbox.oftrust.net/products/{version}/{product_code}',
        headers=headers,
        json=json
    )
    
    print({
        'raw_body': response.json(),
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X PUT \
         -H "Authorization: Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN" \
         -H "Content-Type: application/json" \
         -d \
    "{
        \"dataContext\" : \"https://example.com/v1/Context/Data\",
        \"parameterContext\" : \"https://example.com/v1/Context/Parameter\",
        \"productCode\" : \"product-1\",
        \"name\" : \"Product name\",
        \"translatorUrl\" : \"https://example.com/translator\",
        \"organizationPublicKeys\" : [ {
            \"url\" : \"https://example.com/public-key.pub\",
            \"type\" : \"RsaSignature2018\"
        }, {
            \"url\" : \"https://example.com/public-key-2.pub\",
            \"type\" : \"RsaSignature2018\"
        } ],
        \"imageUrl\" : \"https://example.com/product-image.png\",
        \"description\" : \"This is a product that returns the temperature data for ...\"
    }" "https://api-sandbox.oftrust.net/products/{version}/{product_code}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN",
        "Content-Type" : "application/json"
    };
    const body = {
        "dataContext" : "https://example.com/v1/Context/Data",
        "parameterContext" : "https://example.com/v1/Context/Parameter",
        "productCode" : "product-1",
        "name" : "Product name",
        "translatorUrl" : "https://example.com/translator",
        "organizationPublicKeys" : [ {
            "url" : "https://example.com/public-key.pub",
            "type" : "RsaSignature2018"
        }, {
            "url" : "https://example.com/public-key-2.pub",
            "type" : "RsaSignature2018"
        } ],
        "imageUrl" : "https://example.com/product-image.png",
        "description" : "This is a product that returns the temperature data for ..."
    };
    
    unirest
      .put("https://api-sandbox.oftrust.net/products/{version}/{product_code}")
      .headers(headers)
      .send(body)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 200
    
    {
      "@context": "https://standards.lifeengine.io/v1/Context/Identity/Thing/HumanWorld/Product/DataProduct",
      "@type": "DataProduct",
      "@id": "https://api-sandbox.oftrust.net/products/v1/product-1",
      "productCode": "product-1",
      "dataContext": "https://example.com/v1/Context/Data",
      "parameterContext": "https://example.com/v1/Context/Parameter",
      "translatorUrl": "https://translator.example.com/fetch-data-product",
      "name": "Product name",
      "organizationPublicKeys": [
        {
          "url": "https://example.com/public-key.pub",
          "type": "RsaSignature2018"
        },
        {
          "url": "https://example.com/public-key-2.pub",
          "type": "RsaSignature2018"
        }
      ],
      "description": "This is a product that returns the temperature data for ...",
      "imageUrl": "https://example.com/product-image.png",
      "identityId": "31b5b971-dc50-4c9c-992a-57c0bf016186"
    }
    
    

    PUT /products/v1/{product_code}

    Parameters

    Name Located in Description Required Type
    product_code path The product code of the product. Yes string
    version path Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string
    body body Yes

    Responses

    Code Description
    200
    404
    422

    delete

    Description: Delete a product by product code

    http request

    Example for: DELETE /products/v1/{product_code}

    import requests
    
    headers={
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN"
    }
    
    
    response = requests.delete(
        'https://api-sandbox.oftrust.net/products/{version}/{product_code}',
        headers=headers,
    )
    
    print({
        'raw_body': response.text,
        'status': response.status_code,
        'code': response.status_code
    })
    
    
    curl -i -X DELETE \
         -H "Authorization: Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN" "https://api-sandbox.oftrust.net/products/{version}/{product_code}"
    
    const unirest = require("unirest");
    
    const headers = {
        "Authorization" : "Bearer eyJ0e.....GciOiJSUzI1NiJ9.eyJzY29wZ....SI6bnVsbCwiZXhwIjoxN"
    };
    
    
    unirest
      .delete("https://api-sandbox.oftrust.net/products/{version}/{product_code}")
      .headers(headers)
      .then(({ raw_body, status, code }) => {
        // output response to console as JSON
        console.log(JSON.stringify({ raw_body, status, code }, null, 4));
      });
    
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    The above example should return JSON structured like this:

    The above example should return JSON structured like this:
    
    HTTP/1.0 204
    
    {}
    
    

    DELETE /products/v1/{product_code}

    Parameters

    Name Located in Description Required Type
    product_code path The product code of the product. Yes string
    version path Yes string
    Authorization header The Authorization header, MUST be Bearer {{access_token}} Yes string

    Responses

    Code Description
    204
    404

    Authentication

    Platform of Trust authentication is OAuth2 based. It's typically a good idea to explain the whole authentication process, because even to this day not everyone is familiar with how they work. In a nutshell this is what we use

    Example how Bearer is expected to be used in headers.

    import sys
    sys.stdout.write("Python example missing. Why not contribute one for us?")
    
    curl https://api-sandbox.oftrust.net/messages/v1/3a9e31ff-b654-4069-8361-6b446dc04c95 \
    -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf"
    
    console.error("Javascript example missing. Why not contribute one for us?");
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    Use Bearer token and how to get it?

    You have two options how to obtain Bearer token depending of your needs.

    To learn and get familiar with APIS:

    Here's an example from Chrome Browser DevTools

    Chrome cookie

    For production:

    Most of the APIs require bearer token in header ("Authorization: Bearer"). Exceptions to the rule are CORS enabled endpoints and Broker API.

    Exception 1: CORS enabled APIs

    APIs with CORS enabled endpoints which do not require any tokens:

    Example how Broker API headers are expected to be given.

    import sys
    sys.stdout.write("Python example missing. Why not contribute one for us?")
    
    curl -X POST https://api-sandbox.oftrust.net/broker/v1/fetch-data-product \
    -H "Content-Type: application/json" \
    -H "X-Pot-Signature: Ioma1gqOVFUBrXiziWSCLqBG4vFozG3YgzPzillNip0=" \
    -H "X-Pot-App: 379780e4-b511-4fa9-aef8-bda9bd58ab89" \
    -H "X-Pot-Token: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzY29w...DVs5aaf" \
    
    console.error("Javascript example missing. Why not contribute one for us?");
    
    System.out.println("Java example missing. Why not contribute one for us?");
    

    Exception 2: Broker API

    Second exception is the Broker API is a bit more complex and requires header parameters:

    Read more from Broker API.

    Get client credentials

    Before jumping into development you might want to get the client credentials. Getting those now let's you jump into code level testing right away without detours.
    For each application you develop, you need to obtain new client credentials. These include a client identifier and a client shared-secret.

    Recommended next step is to register new app:

    1. Login to World app and initiate new application registration.
    2. Fill in the required information and submit.
    3. Upon successful application registration, you will be shown client credentials.

    Authentication code example

    Now you have client credentials and you can start fiddling code and run you app in our sandbox environment. Code speaks for it self! Thus we have open source (MIT license) React sample app which contains authentication implementation among other things. You can clone the sample app from Github.

    Errors

    The Platform of Trust APIs all use the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The item requested is hidden for administrators only.
    404 Not Found -- The specified item could not be found.
    405 Method Not Allowed -- You tried to access item with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The requested item has been removed from our servers.
    422 Unprocessable -- Entity is missing
    429 Too Many Requests -- You're requesting too many times! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

    Feedback

    If you found a bug or missing information in the documentation create an issue in Github.