Client Context object representation

The clientcontext object representation and fields are described below.

clientcontext was introduced in API version V1

clientcontext has not been marked for deprecation

Usages

Description

Representation of the client context metadata to allow callers to understand the current client session state. The client context may be using a regular web session (in the case of your client accessing content via a logged in user session), a bearer token either from a secure server to server context or a bearer token from an insecure browser client. The response JSON will let you understand your session state in order to trigger experiences like logging in a user to allow them to use client features like the Editor or Tasks clients.

Example response representation

{
  "hasSession" : false,
  "hasBearer" : true,
  "client" : {
    "urn" : "3d059a42-2095-4d19-aea9-3243787e1ccd",
    "scope" : "api.baack.co",
    "owner" : {
      "urn" : "32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
      "url" : "/n/v1/company/32a90f18-aaa0-4bdc-a63e-4efd2e16c28c"
    },
    "clientID" : "Bearer"
  },
  "owner" : {
    "urn" : "32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
    "url" : "/n/v1/company/32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
    "name" : "Example company name",
    "parentCompany" : {
      "urn" : "fe7f2716-3541-45d5-833d-b8a14ad386d0",
      "url" : "/n/v1/company/fe7f2716-3541-45d5-833d-b8a14ad386d0"
    },
    "owner" : {
      "urn" : "7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56",
      "url" : "/n/v1/company/7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56"
    },
    "organisation" : {
      "urn" : "0225cc24-77fc-40fe-88dd-66f358a17d56",
      "url" : "/n/v1/organisation/0225cc24-77fc-40fe-88dd-66f358a17d56"
    }
  }
}

Fields

NameTypeDescriptionConstraints
hasSessionBoolean literal e.g. true
hasBearerBoolean literal e.g. true
useruserThe session user if using session based authentication. Note that user objects are ephemeral and may be destroyed. They have an associated identity within the scope of a company
clientapiclientThe API client associated with the request
ownercompanyThe owner company associated with the API client or the company associated with the login from their identity
identityidentityThe identity of the session user in the Baack company
loginIframeSrcURL represented as a stringThe iFrame src value you should use to allow a browser based user to log in to Baack if you are using a browser based client