Skip to content
eMBee edited this page Oct 4, 2019 · 4 revisions

Base URL: http://hostname/scripts/rest.pike?request=

Resource URI: /REST/ (not implemented yet. in a future version this should be accessible as https://hostname/REST/ )

Note:

  • Each user has a workroom at /home/{{user.name}}/ and each group has a workarea at /home/{{group.name}}/
  • Groups can be nested. For instance {{maingroup}}.{{subgroup}}

Register

  • Method: POST

  • URL Params: register (/scripts/rest.pike?request=register | /REST/register)

  • Request payload

{
    "username":"a_name",
    "email":"xx@yy.com",
    "password":"temp",
    "password2":"temp",
    "group":"sTeam"
}
  • Response
{
    "request-method": "POST",
    "request": "register",
    "me": {
        "icon": {
            "oid": 159,
            "size": 778,
            "path": "/images/doctypes/user_unknown.jpg",
            "description": "",
            "title": "",
            "name": "user_unknown.jpg",
            "mime_type": "image/jpeg",
            "class": "Document"
        },
        "documents": 0,
        "oid": 88,
        "vsession": "0",
        "id": "guest",
        "path": "/guest",
        "fullname": "User 1",
        "description": "Guest is the guest user.",
        "name": "guest",
        "links": 0,
        "class": "User"
    },
    "error": "request not found",
    "__version": [
        "2013-07-09-1",
        "20150507 08:28:06"
    ],
    "__date": "20150520 15:22:30"
}

Login

  • Method: GET

  • URL Params: login

  • Example call

curl -D- -u temp:temp -X GET -H "Content-Type: application/json" Base URL : http://hostname/REST/login
  • Supplying the Authentication headers
  1. Build a string in form of username:password
  2. Base64 encode the string
  3. Supply an "Authorization" header with content "Basic " followed by the encoded string. For example, the string "temp:temp" encodes to "dGVtcDp0ZW1w" in base64, so you would make the request as follows.
curl -D- -X GET -H "Authorization: Basic dGVtcDp0ZW1w" -H "Content-Type: application/json" "http://hostname/REST/login"
  • Response
{
    "request-method": "GET",
    "me": {
        "icon": {
            "oid": 159,
            "size": 778,
            "path": "/images/doctypes/user_unknown.jpg",
            "description": "",
            "title": "",
            "name": "user_unknown.jpg",
            "mime_type": "image/jpeg",
            "class": "Document"
        },
        "documents": 0,
        "oid": 11111,
        "vsession": "0",
        "id": "username",
        "path": "/username",
        "fullname": "fullname",
        "description": "temp",
        "name": "name",
        "links": 0,
        "class": "User"
    },
    "error": "request not found",
    "__date": "20150520 15:25:19",
    "login": "login successful",
    "request": "login",
    "__version": [
        "2013-07-09-1",
        "20150507 08:28:06"
    ]
}

Accessing a Room

  • Method: GET

  • URL Params: /path/to/room

  • Response:

{
    "request-method": "GET",
    "me": {
        "icon": {
            "oid": 159,
            "size": 778,
            "path": "/images/doctypes/user_unknown.jpg",
            "description": "",
            "title": "",
            "name": "user_unknown.jpg",
            "mime_type": "image/jpeg",
            "class": "Document"
        },
        "documents": 0,
        "oid": 88,
        "vsession": "0",
        "id": "guest",
        "path": "/guest",
        "fullname": "User 1",
        "description": "Guest is the guest user.",
        "name": "guest",
        "links": 0,
        "class": "User"
    },
    "inventory": [
        {
            "icon": {
                "oid": 174,
                "size": 1435,
                "path": "/images/doctypes/type_generic.gif",
                "description": "",
                "title": "",
                "name": "type_generic.gif",
                "mime_type": "image/gif",
                "class": "Document"
            },
            "oid": 8995,
            "size": 167,
            "path": "/path/to/document/in/a/room",
            "description": "this is a simple text file",
            "title": "this is a simple text file",
            "name": "hello-world",
            "mime_type": "text/plain",
            "class": "Document"
        }
    ],
    "__date": "20150522 07:00:08",
    "request": "/path/to/room",
    "__version": [
        "2013-07-09-1",
        "20150507 08:28:06"
    ],
    "object": {
        "icon": {
            "oid": 179,
            "size": 1256,
            "path": "/images/doctypes/type_area.gif",
            "description": "",
            "title": "",
            "name": "type_area.gif",
            "mime_type": "image/gif",
            "class": "Document"
        },
        "documents": 1,
        "oid": 8989,
        "path": "/path/to/room",
        "description": "",
        "name": "room name",
        "links": 0,
        "class": "Room"
    }
}

Access a Document in a room

  • METHOD: GET

  • URL Params: /path/to/document

  • Response:

{
    "request-method": "GET",
    "me": {
        "icon": {
            "oid": 159,
            "size": 778,
            "path": "/images/doctypes/user_unknown.jpg",
            "description": "",
            "title": "",
            "name": "user_unknown.jpg",
            "mime_type": "image/jpeg",
            "class": "Document"
        },
        "documents": 0,
        "oid": 88,
        "vsession": "0",
        "id": "guest",
        "path": "/guest",
        "fullname": "User 1",
        "description": "Guest is the guest user.",
        "name": "guest",
        "links": 0,
        "class": "User"
    },
    "__date": "20150522 08:58:03",
    "request": "/path/to/document",
    "environment": {
        "icon": {
            "oid": 179,
            "size": 1256,
            "path": "/images/doctypes/type_area.gif",
            "description": "",
            "title": "",
            "name": "type_area.gif",
            "mime_type": "image/gif",
            "class": "Document"
        },
        "documents": 3,
        "oid": 8989,
        "path": "/path/to/room",
        "description": "",
        "name": "room name",
        "links": 0,
        "class": "Room"
    },
    "__version": [
        "2013-07-09-1",
        "20150507 08:28:06"
    ],
    "object": {
        "icon": {
            "oid": 174,
            "size": 1435,
            "path": "/images/doctypes/type_generic.gif",
            "description": "",
            "title": "",
            "name": "type_generic.gif",
            "mime_type": "image/gif",
            "class": "Document"
        },
        "oid": 11198,
        "content": "this is test file to become acquainted with the interface.",
        "size": 58,
        "path": "/path/to/document",
        "description": "this is a test document",
        "title": "this is a test document",
        "name": "test-document",
        "mime_type": "text/plain",
        "class": "Document"
    }
}

Creating Room

Creating Containers

Creating Documents

Creating Groups

Deleting Objects

Clone this wiki locally