# Project controller (/project) - General

The project controller contains many endpoints related to projects, which is where all data is stored. The endpoints are divided in five groups:

  • General
    Get information about available projects and tables within projects, and run a basic check of access and system status.

  • Users
    Manage users that are members of a project.

  • Read
    Read user data from tables.

  • Write
    Create, update or delete user data in tables.

  • Watch
    Watch for changes of user data in tables, and for changes of project members.

# All project endpoints

Below are all endpoints in the entire project controller in alphabetical order. Endpoints in the current group are in bold.

/project/list (GET)
/project/list/all (GET)
/project/{project}/check (GET)
/project/{project}/subjects/watch/register (POST)
/project/{project}/subjects/watch/unregister/{id} (POST)
/project/{project}/subjects/watch/{id} (GET)
/project/{project}/table/{table} (GET)
/project/{project}/table/{table} (POST)
/project/{project}/table/{table} (DELETE)
/project/{project}/table/{table}/filter/delete (POST)
/project/{project}/table/{table}/filter/get (POST)
/project/{project}/table/{table}/filter/get/first (POST)
/project/{project}/table/{table}/filter/get/last (POST)
/project/{project}/table/{table}/first (GET)
/project/{project}/table/{table}/last (GET)
/project/{project}/table/{table}/purge (DELETE)
/project/{project}/table/{table}/spec (GET)
/project/{project}/table/{table}/watch/register (POST)
/project/{project}/table/{table}/watch/unregister/{id} (POST)
/project/{project}/table/{table}/watch/{id} (GET)
/project/{project}/table/{table}/{recordId} (GET)
/project/{project}/table/{table}/{recordId} (PUT)
/project/{project}/table/{table}/{recordId} (DELETE)
/project/{project}/tables (GET)
/project/{project}/user (POST)
/project/{project}/user (DELETE)
/project/{project}/users (GET)

# /list

/project/list GET
Description
Returns the projects that you can access. Users who just signed up will only get the project they initially signed up to. Admins will get all projects.
Authorization
All authenticated users can call this endpoint.
URL parameters
Content
Response (application/json)
JSON array with projects. Each project is a JSON object with the following properties:
code
Project code
name
Project name that can be presented to the user.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/list
X-Auth-Token: ...
Response
[
    {
        "code": "default",
        "name": "Default"
    },
    ...
]

# /list/all

/project/list/all GET
Description
Returns the project codes of all projects, including those that you can’t currently access. Users can add themselves to any project using

/project/{project}/user

.
Authorization
All authenticated users can call this endpoint.
URL parameters
Content
Response (application/json)
JSON array with project codes.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/list/all
X-Auth-Token: ...
Response
[
    "default",
    ...
]

# /{project}/check

/project/{project}/check GET
Description
Checks whether the current user can access the project and the system is working correctly. If you specify a subject, this endpoint will also check whether the current user can access the subject.
Authorization
Users need to have access to the specified project. Admins can access all projects.
URL parameters
{project}
Project code (see

/project/list

)
user
(optional) User ID of the subject user that you want to access
Content
Response
Errors
If the authentication token is not found, invalid or expired.
HTTP status
401 Unauthorized
Code
AUTH_TOKEN_NOT_FOUND, AUTH_TOKEN_INVALID, AUTH_TOKEN_EXPIRED, ACCOUNT_INACTIVE
Field errors
If the current user can’t access the specified subject user.
HTTP status
403 Forbidden
Code
Field errors
If the project is not found or the current user can’t access the project.
HTTP status
404 Not Found
Code
Field errors
If the system is not working correctly.
HTTP status
500 Internal Server Error (or maybe another status including one of the above such as 404 Not Found)
Code
Field errors
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/default/check
    ?user=b43f784d76c44e7a9ae0370b91521753
X-Auth-Token: ...
Response

# /{project}/tables

/project/{project}/tables GET
Description
Returns the names of all tables in the specified project. For the specifications of a table you can call

/project/{project}/table/{table}/spec

.
Authorization
Users need to have access to the specified project. Admins can access all projects.
URL parameters
{project}
Project code (see

/project/list

)
Content
Response (application/json)
JSON array with the names of the tables.
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/default/tables
X-Auth-Token: ...
Response
[
    "steps",
    ...
]

# /{project}/table/{table}/spec

/project/{project}/table/{table}/spec GET
Description
Returns the specification of the specified table.
Authorization
Users need to have access to the specified project. Admins can access all projects.
URL parameters
{project}
Project code (see

/project/list

)
{table}
Name of the table (see

/project/{project}/tables

)
Content
Response (application/json)
JSON object with the following properties:
name
Table name
fields
JSON array with fields (see below)
indexes
JSON array with indexes (see below)
splitByUser
true if the underlying storage has separate tables per user for better performance with large tables, false if all data is stored in one table
A field is a JSON object with the following properties:
name
Field name
type
One of the following types:
BYTE
Signed 8 bits (-128..127)
SHORT
Signed 16 bits (-65536..65535)
INT
Signed 32 bits
LONG
Signed 64 bits
FLOAT
32 bits floating point
DOUBLE
64 bits floating point
STRING
255 characters
TEXT
Long text
DATE
2015-09-20
TIME
14:30:20
DATETIME
2015-09-20 14:30:20
ISOTIME
2015-09-20T14:30:20.000+02:00
An index is a JSON object with the following properties:
name
Index name
fields
JSON array with field names
Example
Request
GET https://www.example.com/servlets/senseeact/v6.1.0/project/default/table/steps/spec
X-Auth-Token: ...
Response
{
    "name": "steps",
    "fields": [
        {
            "name": "user",
            "type": "STRING",
            "elemType": null,
            "subfields": null
        },
        {
            "name": "utcTime",
            "type": "LONG",
            "elemType": null,
            "subfields": null
        },
        ...
    ],
    "indexes": [
        {
            "name": "user",
            "fields": [ "user" ]
        },
        {
            "name": "utcTime",
            "fields": [ "utcTime" ]
        }
    ],
    "splitByUser": true
}