======================== Saved Global Filters API ======================== The saved global filters endpoints provide a way to view saved global filter details by user and stack or delete them. All endpoints require a user to be logged in, and the POST endpoints require CSRF tokens. Get a List of Saved Global Filter Hashes for the Current User ------------------------------------------------------------- .. http:get:: /api/v1/hashr/saved_global_filters/ Get a list of Saved Global Filter Hashes for Current User **Example Request**: .. code:: GET /api/v1/hashr/saved_global_filters/ Accept: application/json **Example Response**: .. code:: HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "user": "chris@juice.com", "stack": "Census for Data Services Demo App", "hash": "aThing", "name": "My Filters", "created": "2016-06-07T15:52:13.600823Z", "modified": "2016-06-07T15:52:13.600864Z" } ] :>jsonarr string user: the email address of the user :>jsonarr string stack: the stack and app for the filter :>jsonarr string hash: the hash associated with the saved filter set :>jsonarr string name: the named given to the saved filter set :>jsonarr datetime created: when the saved filter set was created :>jsonarr datetime modified: when the saved filter set was last modified :reqheader Accept: the response content type depends on ``Accept`` header :resheader Content-Type: application/json :statuscode 200: no error Get a List of Saved Global Filter Hashes for the Current User by Stack ---------------------------------------------------------------------- .. http:get:: /api/v1/hashr/saved_global_filters/stack/(string:stack_id)/ Get a list of Saved Global Filter Hashes for Current User **Example Request**: .. code:: GET /api/v1/hashr/saved_global_filters/stack/a0a91e46/ Accept: application/json **Example Response**: .. code:: HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript [ { "user": "chris@juice.com", "stack": "Census for Data Services Demo App", "hash": "aThing", "name": "My Filters", "created": "2016-06-07T15:52:13.600823Z", "modified": "2016-06-07T15:52:13.600864Z" } ] :param string stack_id: the ID of the stack :>jsonarr string user: the email address of the user :>jsonarr string stack: the stack and app for the filter :>jsonarr string hash: the hash associated with the saved filter set :>jsonarr string name: the named given to the saved filter set :>jsonarr datetime created: when the saved filter set was created :>jsonarr datetime modified: when the saved filter set was last modified :reqheader Accept: the response content type depends on ``Accept`` header :resheader Content-Type: application/json :statuscode 200: no error Get a specific Saved Global Filter Hash for the Current User ------------------------------------------------------------ .. http:get:: /api/v1/hashr/saved_global_filters/(string:hash)/ Get a list of Saved Global Filter Hashes for Current User for a Stack **Example Request**: .. code:: GET /api/v1/hashr/saved_global_filters/aThing/ Accept: application/json **Example Response**: .. code:: HTTP/1.1 200 OK Vary: Accept Content-Type: text/javascript { "user": "chris@juice.com", "stack": "Census for Data Services Demo App", "hash": "aThing", "name": "My Filters", "created": "2016-06-07T15:52:13.600823Z", "modified": "2016-06-07T15:52:13.600864Z" } :param string hash: the hash associated with the saved filter set :>json string user: the email address of the user :>json string stack: the stack and app for the filter :>json string hash: the hash associated with the saved filter set :>json string name: the named given to the saved filter set :>json datetime created: when the saved filter set was created :>json datetime modified: when the saved filter set was last modified :reqheader Accept: the response content type depends on ``Accept`` header :resheader Content-Type: application/json :statuscode 200: no error :statuscode 404: Saved filter set not found Creating a Saved Global Filter Hash for the Current User -------------------------------------------------------- .. http:post:: /api/v1/hashr/saved_global_filters/ Creating a Saved Global Filter Hashes for Current User **Example Request**: .. code:: POST /api/v1/hashr/saved_global_filters/ Accept: application/json { "stack_id": "a0a91e46", "hash": "aThing", "name": "My Filters", } **Example Response**: .. code:: HTTP/1.1 201 CREATED Vary: Accept Content-Type: text/javascript { "user": "chris@juice.com", "stack": "Census for Data Services Demo App", "hash": "aThing", "name": "My Filters", "created": "2016-06-07T15:52:13.600823Z", "modified": "2016-06-07T15:52:13.600864Z" } :json string user: the email address of the user :>json string stack: the stack and app for the filter :>json string hash: the hash associated with the saved filter set :>json string name: the named given to the saved filter set :>json datetime created: when the saved filter set was created :>json datetime modified: when the saved filter set was last modified :reqheader Accept: the response content type depends on ``Accept`` header :resheader Content-Type: application/json :statuscode 200: no error :statuscode 400: Check response data for a message about missing or invalid data Deleting specific Saved Global Filter Hash for the Current User --------------------------------------------------------------- .. http:delete:: /api/v1/hashr/saved_global_filters/(string:hash)/ Deleting a specific Saved Global Filter Hash for Current User **Example Request**: .. code:: DELETE /api/v1/hashr/saved_global_filters/aThing/ Accept: application/json **Example Response**: .. code:: HTTP/1.1 204 NO CONTENT Vary: Accept Content-Type: text/javascript :statuscode 204: Operation Succeeded :statuscode 404: Saved filter set not found Updating specific Saved Global Filter Hash for the Current User --------------------------------------------------------------- .. http:put:: /api/v1/hashr/saved_global_filters/(string:hash)/ Updating a specific Saved Global Filter Hash for Current User **Example Request**: .. code:: PUT /api/v1/hashr/saved_global_filters/aThing/ Accept: application/json { "stack_id": "a0a91e46", "hash": "aThing", "name": "My Renamed Filters", } **Example Response**: .. code:: HTTP/1.1 204 NO CONTENT Vary: Accept Content-Type: text/javascript { "user": "chris@juice.com", "stack": "Census for Data Services Demo App", "hash": "aThing", "name": "My Renamed Filters", "created": "2016-06-07T15:52:13.600823Z", "modified": "2016-06-07T16:52:13.600864Z" } :statuscode 200: no error :statuscode 404: Saved filter set not found