Basic information

Unet API provides a vast range of functionality for getting data and manipulating different Unet entities.

There are also several methods for authorizing data requests:

  1. OAuth 2.0 - allows registered application to make any API request on behalf of authenticated user.
  2. API key - allows to make only small part of requests for public data on behalf of a guest. Requires JSON or JSONP transport. This method is utilized by Javascript API.
  3. Unet session cookies - allows to make inquery requests on behalf of authenticated user. Cannot be used on JSON or JSONP transport.

+Request model

URI composing

  • RESOURCE_URI
    Successful authorization returns the field resource_uri, which contains the prefix that should be used to compose endpoint URIs.

  • WEBDAV_URI
    If an application uses scopes files_read or files_write, then a successful authorization returns the field webdav_uri, which is the root directory of user files.

Methods

  • GET
  • POST

Fields model

Some requests support the fields parameter which describes what data should be returned.
The mark ? next to a field name indicates that the field is not returned by default and must be specified in the fields parameter.
The fields model allows you to exclude from the responce any parameters that are included by default.

Example

"fields": {
    "id": false,
    "title": true,
    "message": true,
    "attachments": true
}

Types

  • single
  • complex

Single request structure

Example

https://00001.unet.com/api/entries/?q={"limit":20}

Complex request structure

Examples

Adding and deleting groups of entries

https://00001.unet.com/api/entries/?q=[
    "add", [
        {
            "title":"Article",
            "message":"Text of the article."
        },
        {
            "title":"Best story",
            "message":"Once upon a time...",
            "publish_at":"2011-11-11T11:11:11+00:00",
            "access":
        }
    ],
    "delete", [
        {"id":391},
        {"id":392},
        {"id":393}
    ]
]

+Response model

Success

TODO: describe the response strucute

Error

TODO


+Data types

  • integer
  • unsigned integer
  • float
  • string
  • timestemp
  • datetime
  • boolean
  • object