Data Scopes

Overview

A connected organisation API requires authentication from either a parent or a child organisation. The data scope header determines what data you can access based on your authentication. It allows you to retrieve data from the parent or child organisation, depending on your authentication.

There are three types of data scopes:

Data Scope Authenticating Organisation Description
SELF The SELF scope provides access to data from the authenticating organisation.
Parent authentication: The response data is limited to the parent organisation.
Child authentication: The response data is limited to the child organisation.
Note: The data scope defaults to SELF if no header is provided.
OTHER The OTHER scope allows access to data from a different child organisation within the same connected organisation. You can list up to two child organisations separated by commas in the CONNECTED-ORGS parameter.
Parent authentication: You can view response data from any specific child organization listed in the CONNECTED-ORGS parameter.
Child authentication
with the child organisation ID specified in the CONNECTED-ORGS parameter
You can view response data from the authenticated child organization specified in the CONNECTED-ORGS parameter.

This is similar to using the SELF data scope with child authentication.

Note: It is mandatory to specify the child organisation in the CONNECTED-ORGS parameter .
ALL The ALL scope provides a unified view of data from both the parent and child organisations.
Parent authentication: You can view response data from the parent and all child organisations within the connected organisation.
Child authentication: You can view response data from both the parent and that specific child organisation only.
Note: A maximum of two child organisation IDs are currently supported. A parent organisation with more than two children in the connected organisation cannot use the ALL scope and will result in an error.
The ALL data scope can be used for GET calls only. This is currently unsupported for POST API calls.

Examples

A healthcare conglomerate has two sub-brands under it, a pharmaceutical brand and a food brand.

Brand Overview:

Parent organisation: Healthsphere
Pharmaceutical brand: MediCare
Food brand: Nourish

Example 1:

Consider a scenario where Healthsphere (parent organisation) wants to retrieve promotion data for a customer who is registered under the parent organisation.

The SELF data scope is used in this case to retrieve promotion data for a customer registered under Healthsphere.

Example 2:

Consider a similar scenario where Healthsphere (parent organization) wants to retrieve promotion data for a customer who is registered under its child organisation Nourish

The OTHER data scope is used in this case to retrieve promotion data for the child organisation Nourish by specifying its organisation ID in the CONNECTED-ORGS parameter.

Example 3:

Consider a scenario where MediCare (child organisation) wants to retrieve promotion data for multiple customers registered under the parent Healthsphere and under itself.

The ALL data scope is used in this case to retrieve promotion data for the parent organisation Healthsphere and child organisation MediCare as a unified response.