Users ================================================= Note: Every endpoint listed in this document is managing JSON objects, so the path structure shown for nested keys is represented in a JSON-style access pattern. Root Path: ``/users/`` Model ------------------------------------------------------ .. list-table:: API endpoint for managing user properties. :widths: 15 5 5 75 :header-rows: 1 :class: table-striped table-bordered table-hover * - Key - Type - Default - Description * - username - string - - * - password - string - - * - name - string - - * - email - string - - * - active - bool - true - * - roles - []string - [] - List ---- Return a list of this collection's items, matching the filter parameters if provided. HTTP Verb: ``GET`` Endpoint: ``/api/v1/users/`` Example Request (cURL):: curl -X GET -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/users/ Example Response:: [ { "username": "johndoe", "name": "John Doe", "roles": [], "active": true, "password": "", "email": "johndoe@example.com", "metadata": {} } ] Get One ------- Return the specified collection item. HTTP Verb: ``GET`` Endpoint: ``/api/v1/users/[id]`` Example Request (cURL):: curl -X GET -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/users/[id] Example Response:: { "username": "johndoe", "name": "John Doe", "roles": [], "active": true, "password": "", "email": "johndoe@example.com", "metadata": {} } Create ------ Store a new instance of the object in the system. All required fields must be specified. HTTP Verb: ``POST`` Endpoint: ``/api/v1/users/`` Example Request (cURL):: curl -X POST -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"username": "johndoe", "name": "John Doe", "roles": [], "active": true, "password": "", "email": "johndoe@example.com", "metadata": {}}' https://.enfixlp.com/api/v1/users/ Example Response:: { "resource_url": "https://.enfixlp.com/api/v1/users/51b1e78dbd7a844089b652a9/", "_id": "51b1e78dbd7a844089b652a9" } Replace ------- This is a full model replacement of the specified item, every required field must be specified. HTTP Verb: ``PUT`` Endpoint: ``/api/v1/users/[id]`` Example Request (cURL):: curl -X PUT -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"username": "johndoe", "name": "John Doe", "roles": [], "active": true, "password": "", "email": "johndoe@example.com", "metadata": {}}' https://.enfixlp.com/api/v1/users/[id] Example Response:: No body, Status Code 204. Update ------ On an update, you may specify only the fields you wish to update. All other fields will be preserved as currently stored. HTTP Verb: ``PATCH`` Endpoint: ``/api/v1/users/[id]`` Example Request (cURL):: curl -X PUT -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" -d '{"username": "johndoe"}' https://.enfixlp.com/api/v1/users/[id] Example Response:: No body, Status Code 204. Delete ------ Permanently remove an item from the collection. HTTP Verb: ``DELETE`` Endpoint: ``/api/v1/users/[id]`` Example Request (cURL):: curl -X DELETE -H "App-Token: [APP_TOKEN]" -H "Token: [TOKEN]" -H "Content-Type: application/json" https://.enfixlp.com/api/v1/users/[id] Example Response:: No body, Status Code 200.