GET /api/users/:user_id/table_preferences
列出用户的表偏好

示例

GET /api/users/988725677/table_preferences
403
{
  "error": {
    "message": "Access denied",
    "details": "You are trying access the preferences of a different user",
    "missing_permissions": null
  }
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer


GET /api/users/:user_id/table_preferences/:name
一个指定表的表偏好详情

示例

GET /api/users/135138680/table_preferences/test_subscriptions_resource
200
{
  "id": 2,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-11-07 08:53:02 UTC",
  "updated_at": "2019-11-07 08:53:02 UTC"
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

name
必填

Validations:

  • Must be a String


POST /api/users/:user_id/table_preferences
为一个指定的表创建表偏好

示例

POST /api/users/135138680/table_preferences
{
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "table_preference": {
    "name": "test_subscriptions_resource",
    "columns": [
      "1",
      "2",
      "3"
    ]
  }
}
201
{
  "id": 1,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-11-07 08:53:02 UTC",
  "updated_at": "2019-11-07 08:53:02 UTC"
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

table_preferences
必填

Validations:

  • Must be a Hash

table_preferences[name]
必填

表的名称

Validations:

  • Must be a String

table_preferences[columns]
选填

用户选择的栏目列表

Validations:

  • Must be an array of any type


PUT /api/users/:user_id/table_preferences/:name
为一个指定的表更新表偏好

示例

PUT /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "columns": [
    "1",
    "2",
    "3"
  ],
  "table_preference": {
    "columns": [
      "1",
      "2",
      "3"
    ]
  }
}
200
{
  "id": 3,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-11-07 08:53:02 UTC",
  "updated_at": "2019-11-07 08:53:02 UTC"
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

table_preferences
必填

Validations:

  • Must be a Hash

table_preferences[name]
必填

表的名称

Validations:

  • Must be a String

table_preferences[columns]
选填

用户选择的栏目列表

Validations:

  • Must be an array of any type


DELETE /api/users/:user_id/table_preferences/:name
为一个指定的表删除表偏好

示例

DELETE /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "table_preference": {}
}
200
{
  "id": 4,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2019-11-07 08:53:02 UTC",
  "updated_at": "2019-11-07 08:53:02 UTC"
}

参数

参数名字 描述
location_id
选填

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
选填

Set the current organization context for the request

Validations:

  • Must be a Integer

name
必填

表的名称

Validations:

  • Must be a String