API Reference
v3
Owners

Owners API

Every Onli has an Owner. An Owner is an Onli ID tightly coupled to a Gene. This is stored in an Owners Vault. Onli ID can be used for Authentication and Authorization on the Onli_One network. Appliance have Users, which are created and controlled by the Appliance developer. Users are provisioned by the Appliance developer. Owners are initially created by an Appliance. If the User is not an existing Owner then it can be provisioned by the Appliance. if the user already exists, their Owner object can be added to your Appliance stack. Owners are in complete control of their Owner Object. Appliances are in complete control of their User Object. In developing an Appliance you are connecting an Owner Object to a User Object.


Create

Create an Onli Owner Object, and add them as a user of your appliance.

Request

AttributeDescription
identity.onli_you_idonli_you_id for new owner
identity.app_symbolName of appliance making request
identity.app_keyOnli Cloud API Key
identity.emailEmail address of owner to invite
identity.phonePhone number of owner to invite (include Country Code, e.g. +1 )
context.appliances.<$APP_SYMBOL>.user_classAppliance labelled value that controls users capabilities
context.appliances.<$APP_SYMBOL>.extraDynamic set of paired attributes and values for appliance use only

Response

AttributeDescription
statusrpc status code
identity.onli_you_idonli_you_id of newly created owner

Example

Request - CreateOwner
{
    "data": {
        "identity": {
            "onli_you_id": "usr-d0db0415-4238-5a0e-a46b-c4dd39d86be3",
            "app_symbol": "ENGMA",
            "app_key": "hyu774",
            "email": "juan@onli.one",
            "phone": "17787788877"
        },
        "context": {
            "appliances": {
                "ENGMA": {
                    "user_class": "t1",
                    "extra": "{\"group\": \"onlidevs\"}"
                }
            }
        }
    }
}
Response CreateOwner
{
    "status": 0,
    "identity": {
        "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4"
    }
}

Context

MethodCreateOwner
ObjectiveCreate a new Owner on the Onli One Network. Only Appliances can create owners. Appliances create Owners by connecting to Onli One using a remote procedure call to https://$APP_NAME.onli.id
Requirementsonli_you_id app_symbol app_key email phone user_status
ContextOwners API

Onli ID’s are provided to Appliance Developers upon registration. To create an Owner you use the CreateOwner call. This requires an app_key of a registered developer or appliance owner and the app_symbol of a registered appliance. You can get both of these when appliance developer registration is complete.

Get

Retrieve an Onli Owner Object and relevant User Appliance stored data.

Request

AttributeDescription
onli_you_idonli_you_id to authenticate
app_symbolName of appliance making request
app_keyOnli Cloud API Key

Response

AttributeDescription
statusrpc status code
identity.onli_you_idonli_you_id of requested owner
identity.first_nameOwners first name
identity.alt_nameOwners middle or alternate name
identity.last_nameOwners last name
identity.emailOwners email address
identity.alt_emailOwners alternate email address
identity.usernameOwners username
identity.addressOwners address
identity.address_2Owners line 2 of address
identity.cityOwners city
identity.stateOwners state
identity.postalOwners postal code
identity.countryOwners country abbreviation
identity.phoneOwners phone number
identity.companyOwners company or Company, as specified
identity.statusOwner status on Onli One Network
context.appliances.<$APP_SYMBOL>.user_classAppliance labelled value that controls users capabilities
context.appliances.<$APP_SYMBOL>.statusAppliance user status
context.appliances.<$APP_SYMBOL>.extraDynamic set of paired attributes and values for appliance use only

Example

Request - GetOwner
// Request
{
    "onli_you_id": "usr-d0db0415-4238-5a0e-a46b-c4dd39d86be3",
    "app_symbol": "ENGMA",
    "app_key": "hyu774",
}
Response - GetOwner
// Response
{
    "status": 0,
    "data": {
        "identity": {
            "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
            "first_name": "Sherlock",
            "alt_name": "thinkpipe",
            "last_name": "Holmes",
            "email": "sherlock@holmes.com",
            "alt_email": "sleuth@ing.com",
            "username": "1deduction",
            "address": "221B Baker Street",
            "address_2": "123 Street",
            "city": "London",
            "state": "Manchester",
            "postal": "22455",
            "country": "England",
            "phone": "+447975777666",
            "company": "",
            "status": "STATUS_ACTIVE"
        },
        "context": {
            "appliances": {
                "ENGMA": {
                    "user_class": "T1",
                    "status": "STATUS_APP_ACTIVE",
                    "extra": "{\"group\": \"detective\"}"
                }
            }
        }
    }
}

Context

MethodGetOwner
ObjectiveGet an owners data from the Onli One Network
Requirementsonli_you_id app_symbol app_key
ContextOwners API

Onli_One runs on the cloudMode storage framework. This means every object has three sections or set of values(called entities); Identity, Content and Context. The data stored in Identity is controlled by the Owner. Context contains Appliance controlled information. The key context.appliances is a dynamic key-value portion that appliance developers can use that is a part of the Owner Object. It is up to the appliance developers to create and maintain the data in this section. Storing context dependent data in context.appliances is an excellent way to extend the owners attributes for your Appliance.

Fetch

A lightweight Get-ish method that returns a singlur owner attribute value instead of a scope of owner attributes or entire entity.

Request

AttributeDescription
onli_you_idonli_you_id to authenticate
app_symbolName of appliance making request
app_keyOnli Cloud API Key
conditionCondition to fetch from owner object, includes entity.attribute

Response

AttributeDescription
statusrpc status code
dataSpecified entity.attribute + value

Example 1: Fetch Owner Identity Email

Request - FetchOwner - Owner Identity Email
{
    "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
    "app_symbol": "ENGMA",
    "app_key": "hyu774",
    "condition": "identity.email"
}
Response - FetchOwner - Owner Identity Email
{
    "status": 0,
    "data": {
        "identity": {
            "email": "sherlock@holmes.com",
        }
    }
}

Example 2: Fetch User Appliance Data

Request - FetchOwner
{
    "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
    "app_symbol": "ENGMA",
    "app_key": "hyu774",
    "condition": "context.appliances.ENGMA"
}
Response - FetchOwner
{
    "status": 0,
    "data": {
        "context": {
            "appliances": {
                "ENGMA": {
                    "user_class": "T1",
                    "status": "STATUS_APP_ACTIVE",
                    "extra": "{\"group\":\"detective\"}"
                }
            }
        }
    }
}

Context

MethodFetchOwner
ObjectiveFetch a specific owner attribute from the Onli One Network.
Requirementsonli_you_id app_symbol app_key condition
ContextOwners API

FetchOwner has a condition attribute in the rpc message that gives Developers the ability to control the scope of their requests. If a Developer requires just their contextual appliance data, they can retrieve it by specifying the following in the FetchOwner Reqeust: "condition": "context.appliances.ENGMA". See Example 2 above.

List

List all of the Owners that are Users of your Appliance. Retrieve full data objects or specified attribute values in the conditions.

Request

AttributeDescription
app_symbolName of appliance making request
app_keyOnli Cloud API Key
conditionCondition to fetch from owner object, includes entity.attribute
metalimit max amount of owners to return, offset amount of owners to skip

Response

AttributeDescription
statusrpc status code
dataArray of owners with specified entity.attribute + value
metalimit max amount of owners to return, offset amount of owners to skip

Example

Request - ListOwner
{
    "app_symbol": "ENGMA",
    "app_key": "hyu774",
    "condition": "identity.email",
    "meta": {
        "limit": 2,
        "offset": 0
    }
}
Response - ListOwner
{
    "data": [
        "identity": {
            "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
            "email": "sherlock@holmes.com",
        },
        "identity": {
            "onli_you_id": "usr-rj8be5ae-8593-5d91-8889-6bda935337g6",
            "email": "enola@holmes.com",
        }
    ],
    "status": 0,
    "meta": {
        "limit": 2,
        "offset": 0,
    }
}

Context

MethodListOwner
ObjectiveList owners that are members of a specific Appliance from the Onli One Network.
Requirementsonli_you_id app_symbol app_key condition meta
ContextOwners API

ListOwners has a condition attribute in the rpc message that gives Developers the ability to control the scope of their requests. If a Developer requires just their contextual appliance data, they can retrieve it by specifying the following in the ListOwner Reqeust: "condition": "context.appliances.ENGMA"

Update

Update an attribute of an Owners Appliance data by specifiying the attribute and desired value to update.

Request

AttributeDescription
identity.onli_you_idonli_you_id to authenticate
app_symbolName of appliance making request
<$PATH.TO.CONDITIONS>Path to conditions for entity.attribute.value(s) to be updated

Response

AttributeDescription
statusrpc status code
identity.onli_you_idonli_you_id of requested owner

Example

Request - UpdateOwner
{
    "data": {
        "identity": {
            "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
            "app_symbol": "ENGMA",
            "app_key": "hyu774",
        },
        "context": {
            "appliances": {
                "ENGMA": {
                    "status": 2,
                    "extra": "{\"group\": \"day-trader\"}"
                }
            }
        }
    }
}
Response - UpdateOwner
{
    "status": 0,
    "identity": {
        "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4"
    }
}

Context

MethodUpdateOwner
ObjectiveUpdate an Owners Appliance specific data on the Onli One Network.
Requirementsonli_you_id app_symbol app_key condition
ContextOwners API
⚠️

UpdateOwner gives developers control over the appliances attribute in the rpc message. While this rpc does not replace the entire existing bloc (re: REST PUT) please take care not to update the entire context of an owner when only one attribute is desired. UpdateOwner attributes will only be updated if the attribute exists, thus if the attribute doesn't exist, the service will create the key value.

Add

Add an existing Owner as a User of your Appliance. Serves as a notification that requires Owner authorization to complete.

Request

AttributeDescription
owneronli_you_id to authenticate
app_symbolName of appliance making request
app_keyOnli Cloud API Key
appliance.user_classAppliance labelled value that controls users capabilities
appliance.extraDynamic set of paired attributes and values for appliance use only

Response

AttributeDescription
statusrpc status code
successbool value indicating addowner status

Example

Request - AddOwner
{
    "data": {
        "onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
        "app_symbol": "LUCRA",
        "app_key": "hyu774",
        "appliance": {
            "user_class": "L3",
            "extra": "{\"group\": \"Lucra Financial\"}"
        }
    }
}
Response - AddOwner
{
    "status": 0,
    "success": true
}

Context

MethodAddOwner
ObjectiveAdd an existing Owner to your appliance on the Onli One Network.
Requirementsonli_you_id app_symbol app_key user_class
ContextOwners API

AddOwner serves as a confirmation of an existing Owner requesting to be a member of your Appliance. Owners must first request to be a member of your Appliance, then and only then will you be able to add them as an owner of your appliance. All Appliances can receive membership requests through the Onli Cloud App.