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
Attribute | Description |
---|---|
identity.onli_you_id | onli_you_id for new owner |
identity.app_symbol | Name of appliance making request |
identity.app_key | Onli Cloud API Key |
identity.email | Email address of owner to invite |
identity.phone | Phone number of owner to invite (include Country Code, e.g. +1 ) |
context.appliances.<$APP_SYMBOL>.user_class | Appliance labelled value that controls users capabilities |
context.appliances.<$APP_SYMBOL>.extra | Dynamic set of paired attributes and values for appliance use only |
Response
Attribute | Description |
---|---|
status | rpc status code |
identity.onli_you_id | onli_you_id of newly created owner |
Example
{
"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\"}"
}
}
}
}
}
{
"status": 0,
"identity": {
"onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4"
}
}
Context
Method | CreateOwner |
---|---|
Objective | Create 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 |
Requirements | onli_you_id app_symbol app_key email phone user_status |
Context | Owners 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
Attribute | Description |
---|---|
onli_you_id | onli_you_id to authenticate |
app_symbol | Name of appliance making request |
app_key | Onli Cloud API Key |
Response
Attribute | Description |
---|---|
status | rpc status code |
identity.onli_you_id | onli_you_id of requested owner |
identity.first_name | Owners first name |
identity.alt_name | Owners middle or alternate name |
identity.last_name | Owners last name |
identity.email | Owners email address |
identity.alt_email | Owners alternate email address |
identity.username | Owners username |
identity.address | Owners address |
identity.address_2 | Owners line 2 of address |
identity.city | Owners city |
identity.state | Owners state |
identity.postal | Owners postal code |
identity.country | Owners country abbreviation |
identity.phone | Owners phone number |
identity.company | Owners company or Company, as specified |
identity.status | Owner status on Onli One Network |
context.appliances.<$APP_SYMBOL>.user_class | Appliance labelled value that controls users capabilities |
context.appliances.<$APP_SYMBOL>.status | Appliance user status |
context.appliances.<$APP_SYMBOL>.extra | Dynamic set of paired attributes and values for appliance use only |
Example
// Request
{
"onli_you_id": "usr-d0db0415-4238-5a0e-a46b-c4dd39d86be3",
"app_symbol": "ENGMA",
"app_key": "hyu774",
}
// 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
Method | GetOwner |
---|---|
Objective | Get an owners data from the Onli One Network |
Requirements | onli_you_id app_symbol app_key |
Context | Owners 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
Attribute | Description |
---|---|
onli_you_id | onli_you_id to authenticate |
app_symbol | Name of appliance making request |
app_key | Onli Cloud API Key |
condition | Condition to fetch from owner object, includes entity.attribute |
Response
Attribute | Description |
---|---|
status | rpc status code |
data | Specified entity.attribute + value |
Example 1: Fetch Owner Identity Email
{
"onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
"app_symbol": "ENGMA",
"app_key": "hyu774",
"condition": "identity.email"
}
{
"status": 0,
"data": {
"identity": {
"email": "sherlock@holmes.com",
}
}
}
Example 2: Fetch User Appliance Data
{
"onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
"app_symbol": "ENGMA",
"app_key": "hyu774",
"condition": "context.appliances.ENGMA"
}
{
"status": 0,
"data": {
"context": {
"appliances": {
"ENGMA": {
"user_class": "T1",
"status": "STATUS_APP_ACTIVE",
"extra": "{\"group\":\"detective\"}"
}
}
}
}
}
Context
Method | FetchOwner |
---|---|
Objective | Fetch a specific owner attribute from the Onli One Network. |
Requirements | onli_you_id app_symbol app_key condition |
Context | Owners 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
Attribute | Description |
---|---|
app_symbol | Name of appliance making request |
app_key | Onli Cloud API Key |
condition | Condition to fetch from owner object, includes entity.attribute |
meta | limit max amount of owners to return, offset amount of owners to skip |
Response
Attribute | Description |
---|---|
status | rpc status code |
data | Array of owners with specified entity.attribute + value |
meta | limit max amount of owners to return, offset amount of owners to skip |
Example
{
"app_symbol": "ENGMA",
"app_key": "hyu774",
"condition": "identity.email",
"meta": {
"limit": 2,
"offset": 0
}
}
{
"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
Method | ListOwner |
---|---|
Objective | List owners that are members of a specific Appliance from the Onli One Network. |
Requirements | onli_you_id app_symbol app_key condition meta |
Context | Owners 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
Attribute | Description |
---|---|
identity.onli_you_id | onli_you_id to authenticate |
app_symbol | Name of appliance making request |
<$PATH.TO.CONDITIONS> | Path to conditions for entity.attribute.value(s) to be updated |
Response
Attribute | Description |
---|---|
status | rpc status code |
identity.onli_you_id | onli_you_id of requested owner |
Example
{
"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\"}"
}
}
}
}
}
{
"status": 0,
"identity": {
"onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4"
}
}
Context
Method | UpdateOwner |
---|---|
Objective | Update an Owners Appliance specific data on the Onli One Network. |
Requirements | onli_you_id app_symbol app_key condition |
Context | Owners 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
Attribute | Description |
---|---|
owner | onli_you_id to authenticate |
app_symbol | Name of appliance making request |
app_key | Onli Cloud API Key |
appliance.user_class | Appliance labelled value that controls users capabilities |
appliance.extra | Dynamic set of paired attributes and values for appliance use only |
Response
Attribute | Description |
---|---|
status | rpc status code |
success | bool value indicating addowner status |
Example
{
"data": {
"onli_you_id": "usr-dc8be5ae-8593-5d91-8889-6bda935336f4",
"app_symbol": "LUCRA",
"app_key": "hyu774",
"appliance": {
"user_class": "L3",
"extra": "{\"group\": \"Lucra Financial\"}"
}
}
}
{
"status": 0,
"success": true
}
Context
Method | AddOwner |
---|---|
Objective | Add an existing Owner to your appliance on the Onli One Network. |
Requirements | onli_you_id app_symbol app_key user_class |
Context | Owners 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.