GET /api/users/:user_id/table_preferences
List of table preferences for a user

Examples

GET /api/users/980190962/table_preferences
200
{
  "total": 0,
  "subtotal": 0,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

ID of the user

Validations:

  • Must be a String

search
optional

filter results

Validations:

  • Must be a String

order
optional

Sort and order by a searchable field, e.g. '<field> DESC'

Validations:

  • Must be a String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return, 'all' to return all results

Validations:

  • Must match regular expression /\A([1-9]\d*|all)\Z$/.


GET /api/users/:user_id/table_preferences/:name
Table preference details of a given table

Examples

GET /api/users/135138680/table_preferences/test_subscriptions_resource
200
{
  "id": 3,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2022-09-06 14:51:10 UTC",
  "updated_at": "2022-09-06 14:51:10 UTC"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

ID of the user

Validations:

  • Must be a String

name
required

Name of the table

Validations:

  • Must be a String


POST /api/users/:user_id/table_preferences
Creates a table preference for a given table

Examples

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": 2,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2022-09-06 14:51:10 UTC",
  "updated_at": "2022-09-06 14:51:10 UTC"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

ID of the user

Validations:

  • Must be a String

name
required

Name of the table

Validations:

  • Must be a String

columns
optional

List of user selected columns

Validations:

  • Must be an array of any type


PUT /api/users/:user_id/table_preferences/:name
Updates a table preference for a given table

Examples

PUT /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "columns": [
    "1",
    "2",
    "3"
  ],
  "table_preference": {
    "columns": [
      "1",
      "2",
      "3"
    ]
  }
}
200
{
  "id": 1,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2022-09-06 14:51:09 UTC",
  "updated_at": "2022-09-06 14:51:09 UTC"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

ID of the user

Validations:

  • Must be a String

name
required

Name of the table

Validations:

  • Must be a String

columns
optional

List of user selected columns

Validations:

  • Must be an array of any type


DELETE /api/users/:user_id/table_preferences/:name
Delete a table preference for a given table

Examples

DELETE /api/users/135138680/table_preferences/test_subscriptions_resource
{
  "table_preference": {}
}
200
{
  "id": 4,
  "name": "test_subscriptions_resource",
  "columns": [
    "1",
    "2",
    "3"
  ],
  "created_at": "2022-09-06 14:51:10 UTC",
  "updated_at": "2022-09-06 14:51:10 UTC"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

user_id
required

ID of the user

Validations:

  • Must be a String

name
required

Name of the table

Validations:

  • Must be a String