Remote Procedure Call API

The JSON RPC API provides full featured access to data and resources on the One Platform. It is intended for applications that need to do more than just read and write individual points.

If you're completely new to Exosite's APIs, you may want to read the API overview first.

Time Series Data

read - read time series data

write - write new data into a time series

writegroup - write new data into multiple time series

record - write time series data that has already been timestamped

recordbatch - write multiple time series data at specific timestamps

flush - remove time series data

wait - long polling, i.e., wait a data and get response when the data is updated

Resources

create (client) - create a resource that can contain other resources

create (dataport) - create a time series data resource

create (datarule) - create a resource that can perform processing in response to data

create (dispatch) - create a resource for sending notifications

create (clone) - copy an existing resource

move - move an existing resource

update - update an existing resource

info - get information about an existing resource

listing - list the children of a client resource

drop - delete a resource

usage - get usage information for a resource

Aliases

map - create an alias that can be used to refer to a resource

lookup - look up the resource for an alias

unmap - remove an alias for a resource

Shares and Keys

share - generate a code that allows non-owners to access resources

revoke - revoke a share code or CIK

lookup - look up a resource based on a share code

activate - activate a share code or CIK

deactivate - deactivate a share code or CIK

API Libraries

Wrapper libraries are available for this API:

Conventions

This document uses a few notational conventions:

HTTP Request/Response Example

JSON RPC are HTTP POST requests with a body containing a JSON-encoded call. Here is a full example of an HTTP request, with JSON formatted for readability:

POST /onep:v1/rpc/process HTTP/1.1
Host: m2.exosite.com:80
Content-Type: application/json; charset=utf-8
User-Agent: API Example (danweaver@exosite.com)
Content-Length: 235

{
    "auth": {
        "cik": "5de0cfcf7b5bed2ea7a801234567890123456789"
    },
    "calls": [
        {
            "id": 56,
            "procedure": "read",
            "arguments": [
                {
                    "alias": "temperature"
                },
                {
                    "endtime": 1376957311,
                    "limit": 3,
                    "selection": "all",
                    "sort": "desc",
                    "starttime": 1
                }
            ]
        }
    ]
}

Here is the full HTTP response for that request:

HTTP/1.1 200 OK
Date: Tue, 20 Aug 2013 00:08:27 GMT
Content-Length: 90
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Server: nginx

[
    {
        "id": 56,
        "result": [
            [
                1376957195,
                72.2
            ],
            [
                1376957184,
                72.3
            ],
            [
                1376951473,
                72.5
            ]
        ],
        "status": "ok"
    }
]

Making a Request

RPC API requests are HTTP POSTs to /onep:v1/rpc/process and may contain the following headers.

Header Description Required?
Host: m2.exosite.com:80 The host should be either m2.exosite.com for normal Portals accounts or <your domain>.m2.exosite.com for whitebox accounts. At the moment m2.exosite.com works for all types of accounts, but this is not guaranteed to be supported in the future. Both HTTP and HTTPS are supported. Yes
Content-Type: application/json; charset=utf-8 Describes the content type of the body. For the JSON RPC, this is always application/json; charset=utf-8 Yes
User-Agent: API Example (danweaver@exosite.com) If possible your application should identify itself by putting contact information in the User-Agent header. This also is not enforced, but will help us with any support requests you have. No
Content-Length: 235 Content-Length contains the number of bytes in the body of the request. Yes

The body of a request must be valid JSON. See http://www.json.org for details on the JSON format.

The maximum number of consecutive HTTP requests that can be sent via a single connection to the One Platform is 100. In its response to the 100th request on the same connection, the One Platform will send the header "Connection: close" and then close the underlying TCP connection. The client should in this case create a new connection to the One Platform to continue.

Authentication

Requests to the JSON RPC are made on behalf of a particular client in the system, called the "calling client". Every request passes a client key, called a CIK, that functions like a password and grants limited control over that client and full control of that client's subhierarchy. This is somewhat different from other APIs where authentication is done on behalf of a user account that is granted access to a set of resources.

For example, to read from a Portals datasource, you could authenticate with the CIK of the device that owns the datasource or with the CIK of the portal that owns that device, all the way up to the root node of the One Platform tree.

Authentication information is placed in the JSON body of a request, in "auth". The value of the "auth" key can take any of these forms:

Identifying Resources

Many procedures in the API include an argument for identifying a resource to act upon. In this documentation, that resource is identified by <ResourceID>. This argument can take any of these forms:

Request JSON

The body of a request has the following structure:

{
    "auth": {
            "cik": "e469e336ff9c8ed9176bc05ed7fa40daaaaaaaaa"
    },
    "calls": [
        // first call is a read
        {
            "id": 1,
            "procedure": "read",
            "arguments": [
                 // <ResourceID>
                 // descendant RID of calling client
                 "34eaae237988167d90bfc2ffeb666daaaaaaaaaa",
                 {
                     "starttime":1376709504,
                      "endtime":1376709527,
                      "limit":1,
                      "sort":"desc",
                      "selection":"all"
                 }
            ]
        },
        // second call is a write
        {
            "id": 2,
            "procedure": "write",
            "arguments": [
                 // <ResourceID>
                 // instead of an RID string, this call references the
                 // alias of one of the calling client's children.
                 {
                     "alias": "temperature"
                 },
                 65.4
            ]
        }
    ]
}

"id" is an identifier for the call, and may be a number or a string of up to 40 characters. A matching ID is returned in the response. If "id" is omitted for a particular call, no response will be returned. If "id" is omitted for all calls in "calls", no response will be given for the entire request message.

"procedure" and "arguments" are specific to individual procedures and are documented below.

Response JSON

The response body is always JSON, but its format varies based on error handling conditions. If a call succeeds, the body of the response is a JSON list of responses to the calls made in the request:

[
    // response for
    {
        "id": 1,
        "status": "ok",
        "result": [[1376709527, 64.2]]
    }
]

If a particular call fails, the response body is still a list, but "status" for the response for that call is set to something besides "ok", and an "error" key is included:

[{"id": 0,
  "status": "fail",
  "error": {"code": 501,
            "message": "Error",
            "context": "arguments"}]

If the request message causes an error not associated with any given call, the response body is a JSON object like this:

{"error": {"code": 401,
           "message": "Invalid",
           "context": "auth"}}

Time Series Data

read

Read data from a resource.

{
    "procedure": "read",
    "arguments": [
        <ResourceID>,
        {
            "starttime": number = 0
            "endtime": number = <current unix time>,
            "sort": "asc" | "desc" = "desc"
            "limit": number = 1,
            "selection": "all" | "givenwindow" | "autowindow" = "all",
        }
    ],
    "id": 1
}

response

Response is a list of timestamp, value pairs.


// float resource
{
    "status": "ok",
    "result": [[1376709527,64.2]],
    "id": 1
}

// string resource
{
    "status": "ok",
    "result": [[1376950234,"World"],[1376950230,"Hello"]],
    "id": 1
}

// integer resource
{
    "status": "ok",
    "result": [[1376950410,11],[1376950405,10]],
    "id": 1
}

Example

Read the most recent single value for a datasource:

$ curl -d '{"auth":{"cik":"bef3c7f91ac3562e6a2212345678901234567890"},"calls":[{"procedure":"read","arguments":[{"alias":
"log"}, {}],"id":0}]}' -H 'Content-type: application/json; charset=utf-8' http://m2.exosite.com/onep:v1/rpc/process
[{"id":0,"status":"ok","result":[[1390622248,"test value"]]}]

Read the earliest two points for a datasource:

$ curl -d '{"auth":{"cik":"bef3c7f91ac3562e6a2212345678901234567890"},"calls":[{"procedure":"read","arguments":[{"alias":
"log"}, {"sort":"asc", "limit":2}],"id":0}]}' -H 'Content-type: application/json; charset=utf-8' http://m2.exosite.com/onep:v1/rpc/process
[{"id":0,"status":"ok","result":[[1390622242,"second value"],[1390622240,"first value"]]}]

write

Writes a single value to the resource specified.

{
    "procedure": "write",
    "arguments": [
        <ResourceID>,
        <value>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

writegroup

Writes the given values for the respective resources in the list. The difference between calling writegroup and combining multiple write calls into a single request is that writegroup guarantees the points are written at the same timestamp.

{
    "procedure": "writegroup",
    "arguments": [
        [[<ResourceID>, <value>], ...]
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

record

Records a list of historical entries to the resource specified. NOTE: this API is deprecated. Please use recordbatch instead.

{
    "procedure": "record",
    "arguments": [
        <ResourceID>,
        [[<timestamp>, <value>], ...],
        {}
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

recordbatch

Records a list of historical entries to the resource specified.

{
    "procedure": "recordbatch",
    "arguments": [
        <ResourceID>,
        [[<timestamp>, <value>], ...]
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}
{
    "status": [[<timestamp>, 'invalid'], ...],
    "id": 1
}

example

{
    "arguments": [
        "553d1367fa4613f0eea894d1677a13ef1f091150",
        [[1421906172,30],[1421906160,20]]
    ],
    "id": 1,
    "procedure": "recordbatch"
}

response:

{
    "status": [[1421906172, 'invalid']],
    "id": 1
}

flush

Empties the specified resource of data per specified constraints. If no constraints are specified, all data gets flushed.

{
    "procedure": "flush",
    "arguments": [
        <ResourceID>,
        {
            "newerthan": number,
            "olderthan": number
        }
    ],
    "id": 1
}

response

{
    "status": string,
    "id": 1
}

Resources

create (client)

Creates a generic client under the client specified in <ResourceID>.

NOTE: To create a client based on a client model and connected with a serial number, use the portals create device API or the fleet management create client from model POST API instead.

{
    "procedure": "create",
    "arguments": [
        <ResourceID>,
        "client",
        {
            "limits": {
                "client":       number | "inherit" = 0,
                "dataport":     number | "inherit" = 0,
                "datarule":     number | "inherit" = 0,
                "disk":         number | "inherit" = 0,
                "dispatch":     number | "inherit" = 0,
                "email":        number | "inherit" = 0,
                "email_bucket": number | "inherit" = 0,
                "http":         number | "inherit" = 0,
                "http_bucket":  number | "inherit" = 0,
                "share":        number | "inherit" = 0,
                "sms":          number | "inherit" = 0,
                "sms_bucket":   number | "inherit" = 0,
                "xmpp":         number | "inherit" = 0,
                "xmpp_bucket":  number | "inherit" = 0
            },
            "locked": boolean = false,
            "meta": string = "",
            "name": string = "",
            "public": boolean = false
        }
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1,
    "result": "<ResourceID>"
}

create (dataport)

Creates a dataport.

{
    "procedure": "create",
    "arguments": [
        "dataport",
        {
            "format": "float" | "integer" | "string",
            "meta": string = "",
            "name": string = "",
            "preprocess": list = [],
            "public": boolean = false,
            "retention": {
                "count": number | "infinity",
                "duration": number | "infinity"
            },
            "subscribe": <ResourceID> |  null = null
       }
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1,
    "result": "<ResourceID>"
}

create (datarule)

Creates a datarule.

{
    "procedure": "create",
    "arguments": [
        "datarule",
        {
            "format": "float" | "integer" | "string",
            "meta": string = "",
            "name": string = "",
            "preprocess": list = [],
            "public": boolean = false,
            "retention": {
                "count": number | "infinity",
                "duration": number | "infinity"
            }
            "rule": object,
            "subscribe": <ResourceID> | null = null
        }
    ],
    "id": 1
}

RuleDescription

{
    "simple": {
        "comparison": "gt" | "lt" |
                      "eq" | "geq" |
                      "leq" | "neq",
        "constant": number,
        "repeat": boolean
    }
}

Values received by this rule are compared to a numerical constant and the result is the boolean result of that comparison.

  • "constant" is a numerical constant used by comparison
  • "comparison" is the comparison to perform.
  • "repeat" specifies whether new inputs that would not change the output should be written to the output data stack anyway. If set to true, the output of this rule is always written to the rule's data stack. If set to false, a output is only written if it's different from the previous value.

{
    "timeout": {
        "timeout": number,
        "repeat": boolean
    }
}

Output true if no input value is received within a timeout period. If an input value is received within the period, output false. The timer is restarted when an input value is received, when the timeout elapses and when the script is first started. A timeout value of 0 indicates that the timeout shall not repeat.

  • "timeout" is a timeout in seconds
  • "repeat" specifies whether new inputs that would not change the output should be written to the output data stack anyway. If set to true, the output of this rule is always written to the rule's data stack. If set to false, a output is only written if it's different from the previous value.

{
    "interval": {
        "comparison": "gt" | "lt" |
                      "eq" | "geq" |
                      "leq" | "neq",
        "constant": number,
        "timeout": number,
        "repeat": boolean
    }
}

This rule outputs the result of the comparison any time an input value is received. Additionally, if the comparison result is true, a timer is started. If the timer elapses, the rule output becomes true, and the timer is restarted. If a input value is received that makes the comparison false, false is output and the timer is canceled.

  • "comparison" is the comparison to do
  • "constant" is a numerical constant used by comparison
  • "timeout" is a timeout in seconds
  • "repeat" specifies whether new inputs that would not change the output should be written to the output data stack anyway. If set to true, the output of this rule is always written to the rule's data stack. If set to false, a output is only written if it's different from the previous value.

{
    "duration": {
        "comparison": "gt" | "lt" |
                      "eq" | "geq" |
                      "leq" | "neq",
        "constant": number,
        "timeout": number,
        "repeat": boolean
    }
}

When a value is received, it is immediately used in the configured comparison. If the comparison result is true, the rule waits for the specified timeout period before setting its output to true. If instead the comparison result is false, then false becomes the output of the rule immediately, cancelling any existing timeout.

  • "comparison" is the comparison to do
  • "constant" is a numerical constant used by comparison
  • "timeout" is a timeout in seconds
  • "repeat" specifies whether output from this rule should be written to its data stack if it is the same as the latest value already on the data stack. If set to true, the output of this rule is always written to the rule's data stack. If set to false, a output is only written if it is different from the previous value.


{
    "count": {
        "comparison": "gt" | "lt" |
                      "eq" | "geq" |
                      "leq" | "neq",
        "constant": number,
        "count": number,
        "timeout": number,
        "repeat": boolean
    }
}

When a value is received it is used in the comparison. If the comparison result is true and there is no existing timeout then a timeout is started and an internal counter is set to 1. If a timeout already exists then the internal counter is incremented. If the internal counter matches the count configuration parameter, then the timeout is restarted, the internal counter is set to 0 and the condition evaluates to true. If the timeout elapses, the counter is set to 0, the timeout is cancelled and the rule outputs false.

  • "comparison" is the comparison to do
  • "constant" is a numerical constant used by comparison
  • "count" is the number of data points accumulated that satisfy the comparison
  • "timeout" is a timeout in seconds
  • "repeat" specifies whether output from this rule should be written to its data stack if it is the same as the latest value already on the data stack. If set to true, the output of this rule is always written to the rule's data stack. If set to false, a output is only written if it is different from the previous value.


{
    "script": string
}
"script" is a string containing Lua source code to run on the server.

response

{
    "status": "ok",
    "id": 1,
    "result": "<ResourceID>"
}

create (dispatch)

Creates a dispatch.

{
    "procedure": "create",
    "arguments": [
        "dispatch",
        {
            "locked": boolean = false,
            "message": string = "",
            "meta": string = "",
            "method": "email" | "http_get" | "http_post" | "http_put" | "sms" | "xmpp",
            "name": string = "",
            "preprocess": list = [],
            "public": boolean = false,
            "recipient": string,
            "retention": {
                "count": number | "infinity",
                "duration": number | "infinity"
            },
            "subject": string,
            "subscribe": <ResourceID> | null = null
        }
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1,
    "result": "<ResourceID>"
}

create (clone)

Create a clone from an existing One Platform resource given its RID or a non-activated sharecode for that resource. The resource to clone must be a client.

{
    "procedure": "create",
    "arguments": [
        "clone",
        {
             // 'rid' and 'code' are mutually exclusive options
             "rid": string,
             "code": string,
             "noaliases":boolean = false,
             "nohistorical":boolean = false
        }
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1,
    "result": "<ResourceID>"
}

move

Moves a resource from one parent client to another.

{
    "procedure": "move",
    "arguments": [
        <ResourceID>,
        <DestinationClientID>,
        <Options>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

update

Updates the description of the resource.

{
    "procedure": "update",
    "arguments": [
        <ResourceID>,
        <description>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

wait

This is a HTTP Long Polling API which allows a user to wait on specific resources to be updated. It will return a timestamp which is the time the resource was updated.

{
    "auth": {
        "cik": <CIK>
    },
    "calls": [
        {
            "procedure": "wait",
            "arguments": [
                <ResourceID>,
                {
                    "timeout": <Number> = 30000
                    "since": <Timestamp> = null
                }
            ],
            "id": 1
        }
    ]
}

The following is an JSON example of the wait API.

{
  "auth": {
    "cik": "1c5410607e30469aeedfe899b56011f5ce51ffed",
  },
  "calls": [
    {
      "procedure": "wait",
      "arguments": [
        {"alias": "wait_dataport"},
        {
          "timeout": 5000,
          "since": null
        }
      ],  
      "id": 1
    }
  ]
}

The following is an example to wait with default timeout, 30 seconds from now.

{
  "auth": {
    "cik": "1c5410607e30469aeedfe899b56011f5ce51ffed",
  },
  "calls": [
    {
      "procedure": "wait",
      "arguments": [
          {"alias": "wait_dataport"},
          {}
      ],  
      "id": 1
    }
  ]
}

response

{
    "status": string,
    "result": [timestamp, value],
    "id": 1
}

info

Request creation and usage information of specified resource according to the specified options. Information is returned for the options specified. If no option is specified, a full information report is returned.

{
    "procedure": "info",
    "arguments": [
        <ResourceID>,
        // <options>
        {
            "aliases": true,
            "basic": true,
            "counts": true,
            "description": true,
            "key": true,
            "shares": true,
            "storage":true,
            "subscribers":true,
            "tagged": true,
            "tags": true,
            "usage": true
        }
    ],
    "id": 1
}

Clients can call info on any resource in their sub-hierarchy, including themselves. The type of info available to the caller depends on whether the caller is the client itself on which info is being called or the resource's direct owner or some other client up the hierarchy. For information about making a call on behalf of a particular client, see Authentication.

Available to any client up the hierarchy:

Available only to the client's direct owner and itself:

Available only to the client's direct owner.

response

{
    "status": "ok",
    "id": 1,
    "result": {
        "aliases": {
            // Child resource to alias mapping. If calling client is not
            // the aliased resource or its owner, the value is "undefined"
            // rather than a list of aliases.
            "1b1ae80c224b4df0c74401234567890123456789": [
                "myinteger"
            ],
            "6154e05357efac4ec3d801234567890123456789": [
                "temperature",
                "myfloat"
            ],
        },
        "basic": {
            // The timestamp at which this resource was last updated via
            // the 'update' API.
            "modified": 1374553089,
            // The current status of this resource. Applicable to client
            // and dispatch type resources only.
            // "activated" | "locked" | "notactivated"
            "status": "activated",
            // the number of resources subscribed to this one
            "subscribers": 0,
            // Type of resource
            // "client" | "dataport" | "datarule" | "dispatch"
            "type": "client"
        },
        // The actual count of the resources/consumables used by the client on which info
        // was called. This is different from "usage" in that "counts" does not include
        // resources allocated to subresources but not actually used by them.
        "counts": {
            "client": 3,
            "dataport": 14,
            "datarule": 0,
            "disk": 40516,
            "dispatch": 0,
            "email": 0,
            "http": 0,
            "share": 0,
            "sms": 0,
            "xmpp": 0
        },
        // description as passed to create procedure
        "description": {
            "limits": {
                "client": 500,
                "dataport": 10000,
                "datarule": 5100,
                "disk": "inherit",
                "dispatch": 5100,
                "email": 2500,
                "email_bucket": "inherit",
                "http": 1000,
                "http_bucket": "inherit",
                "share": 5100,
                "sms": 5,
                "sms_bucket": 30,
                "xmpp": 1000,
                "xmpp_bucket": "inherit"
            },
            "locked": false,
            "meta": "",
            "name": "Dev",
            "public": false
        },
        // List of shares in this format:
        // {"activator": Activator,  client that activated the code
        //                           or null if the code has not yet
        //                           been activated.
        //  "code": Code,            The code to be used to activate
        //                           the share.
        //  "meta": Meta}            Meta information string, similar to
        //                           the meta field in resource descriptions.
        "shares": [],
        // List of resources that are subscribed to this one in the form {Type, RID}
        "subscribers": [],
        // Numbers for the resource storage retention
        // Available for dataport, datarule, dispatch only
        "storage":{
            "count":0
           ,"first":0
           ,"last":0
           ,"size":0
        },
        "tagged": [],
        "tags": [],
        "usage": {
            // Number of the respective resource type owned by this
            // and allocated to descendant clients. Applicable to
            // client type resources only.
            "client": 3,
            "dataport": 14,
            "datarule": 0,
            "dispatch": 0,
            // Number of resources
            // shared by this and allocated to descendant clients.
            // Applicable to client type resources only.
            "share": 0,
            // Current total disk space in bytes used by this and descendant
            // clients, expressed in bytes. Applicable to client type
            // resources only.
            "disk": 40516,
            // Current daily usage of the respective dispatch type by this
            // and descendant clients. Applicable to 'client' type
            // resources only.
            "email": 0,
            "http": 0,
            "sms": 0,
            "xmpp": 0
        }
    }
}

listing

Returns lists of RIDs of types specified in <type_list> under client specified in <ResourceID>.

{
    "procedure": "listing",
    "arguments": [
        <ResourceID>,
        <type_list>,
        <options>
    ],
    "id": 1
}

response

{
    "status": string,
    "id": 1
    "result": {
        "client": [],
        "dataport": [   
            "85a85bd51361b976260d01234567890123456789",
            "ba423f0dd8c62039239601234567890123456789",
        ],
        "datarule": [],
        "dispatch": []
    }
}

DEPRECATED If the <options> argument is left out, the result is instead a list of resource IDs in the same order as the input type list. This form of the listing command is deprecated and should not be used.

{
    "status": string,
    "id": 1
    "result": [
        [],
        [
            "85a85bd51361b976260d01234567890123456789",
            "ba423f0dd8c62039239601234567890123456789",
        ],
        [],
        []
    ]
}

drop

Deletes the specified resource. If the resource is a client, the client's subhierarchy are deleted, too. If the resource is a script type datarule, or the hierarchy being dropped contains scripts, the script will be terminated.

NOTE: The drop procedure should only be used to drop generic clients, i.e. clients that were created without a client model. To drop/delete a client based on a client model, use the Portals API delete device. This will free up the serial number associated with that device.

{
    "procedure": "drop",
    "arguments": [
        <ResourceID>,
    ],
    "id": 1
}

response

{
    "status": string,
    "id": 1
}

usage

Returns metric usage for client and its subhierarchy.

{
    "procedure": "usage",
    "arguments": [
        <ResourceID>,
        <metric>,
        <starttime>,
        <endtime>,
    ],
    "id": 1
}

response

{
    "status": "ok",
    "result": number,
    "id": 1
}

Aliases

unmap

Removes a mapping of specified type under the client specified in <ClientID>. After the removal, the previously mapped resource will not be able to be looked up by the mapping.

{
    "procedure": "unmap",
    "arguments": [
        <ClientID>,
        "alias",
        <alias>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

lookup

Look up a Resource ID by alias, owned Resource ID, or share activation code under the client specified in <ClientID>.

{
    "procedure": "lookup",
    "arguments": [
        <ClientID>,
        "alias" | "owner" | "shared",
        <alias> | <ResourceID> | <Code>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "result": <ResourceID>,
    "id": 1
}

Shares and Keys

share

Generates a share code for the given resource. The share code can subsequently be used to activate the share and gain access to the shared resource.

{
    "procedure": "share",
    "arguments": [
        <ResourceID>,
        {
            "meta": <string>
        }
    ],
    "id": 1
}

response

{
    "status": "ok",
    "result": "ab24f30dd8c62039239601234567890123456789"
    "id": 1
}

revoke

Given an activation code, the associated entity is revoked after which the activation code can no longer be used. The calling client must be the owner of the resource with which the activation code is associated.

{
    "procedure": "revoke",
    "arguments": [
        "client" | "share",
        <code>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

activate

Given an activation code, activate an entity for the client specified in <ResourceID>.

{
    "procedure": "activate",
    "arguments": [
        <ResourceID>,
        "client" | "share",
        <code>
    ],
    "id": 1
}

response

{
    "status": string,
    "id": 1
}

deactivate

Given an activation code, deactivate an entity for the client specified in <ResourceID>.

{
    "procedure": "deactivate",
    "arguments": [
        <ResourceID>,
        "client" | "share",
        <code>
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}

map

Creates an alias for a resource. Subsequently the resource can be looked up using the lookup method.

{
    "procedure": "map",
    "arguments": [
        "alias",
        <ResourceID>,
        string  
    ],
    "id": 1
}

response

{
    "status": "ok",
    "id": 1
}