You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 38 Next »

The REST API allows you to perform create, read, update, and delete (CRUD) operations on existing tables.


URL format:

NameValue
Default URLhttps://rest-api.simpleone.ru/

CREATE operations


POST /rest/v1/table/{essence}

This method allows inserting one record in the defined table. It does not support multiple records insertion.

Parameters

ParameterValue
column_namecolumn_value
POST
{
...
<column_name> => <column_value>
...
}

READ operations



GET /rest/v1/table/{essence}

This method returns multiple records for the essence table.


GET /rest/v1/table/{essence}/{sys_id}

This method retrieves one record from the essence table.


UPDATE operations


PUT /rest/v1/table/{essence}/{sys_id}

This method updates the specified record with the request body in the essence table.


PATCH /rest/v1/table/{essence}/{sys_id}

This method updates the specified record with the request body in the essence table.

Parameters

ParameterValue
column_namecolumn_value
PATCH
{
...
<column_name> => <column_value>
...
}

DELETE operations


DELETE /rest/v1/table/{essence}/{sys_id}

Deletes the specified record with the request body from the essence table.


Parameters
NameDescriptionSupported CRUD operations
sysparm_queryAn encoded query string used to filter the results.R
sysparm_display_value

Data retrieval operation method. Also, may return both types of values.

  • TRUE: returns field display values.
  • FALSE: returns actual values.

Default: FALSE

CRU
sysparm_exclude_reference_linkFlag that indicates whether to exclude Table API links for reference fields.

Valid values:

  • TRUE: exclude Table API links for reference fields.
  • FALSE: include Table API links for reference fields.

Default: FALSE

CRU
sysparm_fieldsA comma-separated list of fields to return in the response.CRU
sysparm_viewRender the response according to the specified UI view (overridden by sysparm_fields).CRU
sysparm_limit

The maximum number of results returned per page.

This parameter is equal to the self::CRUD_API_LIMIT_RECORDS.

Default = 20 (for GET-queries).

R
sysparm_page

Page number to offset records.

Default = 1.


Code Examples



sysparm_limit
{
    "status": "OK",
    "data": [
        {
            "sys_id": 156016554400838540,
            "parent_id": null,
            "sys_updated_at": "2019-06-10 11:19:04",
            "impact": null,
            "number": "TSK002930",
            "sys_created_at": "2019-06-10 11:19:04",
            "assigned_user": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "sys_updated_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002930 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": 7,
            "description": null,
            "subject": "1"
        },
        {
            "sys_id": 155964310500002012,
            "parent_id": null,
            "sys_updated_at": "2019-06-18 15:28:32",
            "impact": null,
            "number": "TSK002836",
            "sys_created_at": "2019-02-19 14:30:19",
            "assigned_user": null,
            "sys_updated_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": true,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000026",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000026"
            },
            "closed_at": null,
            "display_name": "TSK002836 ",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": null,
            "assignment_group": null,
            "watcher_list": null,
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Changed",
            "total_points": null,
            "burned_points": null,
            "caller": null,
            "state": 1,
            "description": "",
            "subject": ""
        }
    ]
}

http://rest.simple.test:8080/rest/v1/table/task/156016554400838540

sysparm_page
{
    "status": "OK",
    "data": [
        {
            "sys_id": 156016554400838540,
            "parent_id": null,
            "sys_updated_at": "2019-06-10 11:19:04",
            "impact": null,
            "number": "TSK002930",
            "sys_created_at": "2019-06-10 11:19:04",
            "assigned_user": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "sys_updated_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002930 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": 7,
            "description": null,
            "subject": "1"
        }
    ]
}

sysparm_fields
{
    "status": "OK",
    "data": [
        {
            "sys_id": 155981791201907166,
            "parent_id": null,
            "sys_updated_at": "2019-06-06 10:45:13",
            "impact": null,
            "number": "TSK002918",
            "sys_created_at": "2019-06-06 10:45:13",
            "assigned_user": null,
            "sys_updated_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002918 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": 7,
            "description": null,
            "subject": "1"
        }
    ]
}

sysparm_fields
{
    "status": "OK",
    "data": [
        {
            "sys_id": 155981791201907166,
            "parent_id": null,
            "sys_updated_at": "2019-06-06 10:45:13",
            "impact": null,
            "number": "TSK002918",
            "sys_created_at": "2019-06-06 10:45:13",
            "assigned_user": null,
            "sys_updated_by": "155964310500000018",
            "active": null,
            "opened_at": null,
            "contact": "",
            "sys_created_by": "155964310500000018",
            "closed_at": null,
            "display_name": "TSK002918 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": "",
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": 7,
            "description": null,
            "subject": "1"
        }
    ]
}

sysparm_display_value
{
    "status": "OK",
    "data": [
        {
            "sys_id": 156016554400838540,
            "parent_id": null,
            "sys_updated_at": "2019-06-10 11:19:04",
            "impact": null,
            "number": "TSK002930",
            "sys_created_at": "2019-06-10 11:19:04",
            "assigned_user": {
                "value": "Anna Lukyanova",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "sys_updated_by": {
                "value": "Anna Lukyanova",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "Anna Lukyanova",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002930 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": "Completed",
            "description": null,
            "subject": "1"
        },
        {
            "sys_id": 155964310500002012,
            "parent_id": null,
            "sys_updated_at": "2019-06-18 15:28:32",
            "impact": null,
            "number": "TSK002836",
            "sys_created_at": "2019-02-19 14:30:19",
            "assigned_user": null,
            "sys_updated_by": {
                "value": "Anna Lukyanova",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "active": true,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "Aleksandr Zhulanov",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000026"
            },
            "closed_at": null,
            "display_name": "TSK002836 ",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": null,
            "assignment_group": null,
            "watcher_list": null,
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Changed",
            "total_points": null,
            "burned_points": null,
            "caller": null,
            "state": "Scheduled",
            "description": "",
            "subject": ""
        }
    ]
}

sysparm_exclude_reference_link
{
    "status": "OK",
    "data": [
        {
            "sys_id": 155981791201907166,
            "parent_id": null,
            "sys_updated_at": "2019-06-06 10:45:13",
            "impact": null,
            "number": "TSK002918",
            "sys_created_at": "2019-06-06 10:45:13",
            "assigned_user": null,
            "sys_updated_by": "Anna Lukyanova",
            "active": null,
            "opened_at": null,
            "contact": "",
            "sys_created_by": "Anna Lukyanova",
            "closed_at": null,
            "display_name": "TSK002918 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": "",
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": "Completed",
            "description": null,
            "subject": "1"
        },
        {
            "sys_id": 155983188102317352,
            "parent_id": null,
            "sys_updated_at": "2019-06-06 14:38:01",
            "impact": null,
            "number": "TSK002926",
            "sys_created_at": "2019-06-06 14:38:01",
            "assigned_user": null,
            "sys_updated_by": "Anna Lukyanova",
            "active": null,
            "opened_at": null,
            "contact": "",
            "sys_created_by": "Anna Lukyanova",
            "closed_at": null,
            "display_name": "TSK002926 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": "",
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": 0,
            "burned_points": null,
            "caller": null,
            "state": "Completed",
            "description": null,
            "subject": "1"
        }
    ]
}

CREATE operations

CREATE
{
    "status": "OK",
    "data": [
        {
            "sys_id": 156741210205635452,
            "parent_id": null,
            "sys_updated_at": {
                "expression": "NOW()",
                "params": []
            },
            "impact": null,
            "number": "TSK00031",
            "sys_created_at": {
                "expression": "NOW()",
                "params": []
            },
            "assigned_user": null,
            "sys_updated_by": {
                "value": "155964310500000001",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000001"
            },
            "active": null,
            "opened_at": null,
            "contact": null,
            "sys_created_by": {
                "value": "155964310500000001",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000001"
            },
            "closed_at": null,
            "display_name": "TSK00031 test",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": null,
            "assignment_group": null,
            "watcher_list": null,
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Open",
            "total_points": null,
            "burned_points": null,
            "caller": 156636690504223270,
            "state": null,
            "description": null,
            "subject": "test"
        }
    ]
}

UPDATE operations

UPDATE
{
    "status": "OK",
    "data": [
        {
            "sys_id": 155981791201907166,
            "parent_id": null,
            "sys_updated_at": {
                "expression": "NOW()",
                "params": []
            },
            "impact": null,
            "number": "TSK002918",
            "sys_created_at": "2019-06-06 10:45:13",
            "assigned_user": null,
            "sys_updated_by": {
                "value": "155964310500000001",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000001"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002918 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Changed",
            "total_points": 0,
            "burned_points": null,
            "caller": 156636690504223270,
            "state": 7,
            "description": null,
            "subject": "1"
        }
    ]
}

UPDATE
{
    "status": "OK",
    "data": [
        {
            "sys_id": 155983188102317352,
            "parent_id": null,
            "sys_updated_at": {
                "expression": "NOW()",
                "params": []
            },
            "impact": null,
            "number": "TSK002926",
            "sys_created_at": "2019-06-06 14:38:01",
            "assigned_user": null,
            "sys_updated_by": {
                "value": "155964310500000001",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/155964310500000001"
            },
            "active": null,
            "opened_at": null,
            "contact": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/v1/table/user/"
            },
            "sys_created_by": {
                "value": "155964310500000018",
                "link": "http://rest.simple.test:8080/rest/rest/v1/table/user/155964310500000018"
            },
            "closed_at": null,
            "display_name": "TSK002926 1",
            "steps_to_reproduce": null,
            "priority": null,
            "screenshot": null,
            "attention_required": false,
            "assignment_group": null,
            "watcher_list": {
                "value": "",
                "link": "http://rest.simple.test:8080/rest/rest/v1/table/user/"
            },
            "company": null,
            "work_notes": null,
            "additional_comments": null,
            "closed_by": null,
            "opened_by": null,
            "due_date": null,
            "sys_db_table_id": 155964310500000025,
            "urgency": null,
            "policy": "Changed",
            "total_points": 0,
            "burned_points": null,
            "caller": 155964310500000002,
            "state": 7,
            "description": null,
            "subject": "1"
        }
    ]
}

DELETE operations

DELETE
{
    "status": "OK",
    "data": {
        "description": "Records successfully deleted."
    }
}

DELETE
{
    "status": "ERROR",
    "error_type": "SERVER",
    "errors": [
        {
            "message": "You have no access to delete this records."
        }
    ]
}

Authorization

  • No labels