{"__v":33,"_id":"5542cb0a795b590d001dc7f0","category":{"__v":0,"_id":"5549346a6a82a10d00817a81","pages":[],"project":"551375e1d04af219007ddc52","version":"551375e2d04af219007ddc55","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-05T21:21:46.158Z","from_sync":false,"order":5,"slug":"managing-your-app","title":"Managing Your App"},"project":"551375e1d04af219007ddc52","user":"5539912a0074c80d00621b14","version":{"__v":9,"_id":"551375e2d04af219007ddc55","project":"551375e1d04af219007ddc52","createdAt":"2015-03-26T02:58:42.261Z","releaseDate":"2015-03-26T02:58:42.260Z","categories":["551375e2d04af219007ddc56","5514c6e9bc466623002afddb","5514c6f8fa9cbe2300847841","5514c6fd07274c0d00e620f4","553fe5fc23c53c0d00ccceb4","554113ad5cf9682100d61baa","5549346a6a82a10d00817a81","561be536a3df620d007a1851","563aef87ea247f0d0044d4de"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-01T00:38:34.460Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Users for your app are primarily created using the [Human Connect](doc:overview-of-human-connect) flow. Once you have users you can manage them with either the Developer Portal or the Application API.\n\nBoth methods are described in detail below.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Managing Users via the Developer Portal\"\n}\n[/block]\nOne way to manage users is via the [Developer Portal](doc:developer-portal). From your app homepage, click the 'Users' section to see a list of your app's users.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/vQNM4HGQQWi70BzRemBW_usersdevportal.png\",\n        \"usersdevportal.png\",\n        \"691\",\n        \"360\",\n        \"#3ca966\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nFrom this page, you can see the `humanId`, `Name`, `Email`, `accessToken`, and `publicToken` for a user.\n\nUnder the Options column, you can do two things:\n- See or connect data sources for a user (blue bar icon)\n- Delete that user (red X icon)\n\n#Managing User Data Sources\nBy clicking the blue bar icon in the Options column, you will be able to see what data sources that user has connected. Additionally, there will be a Human Connect button preconfigured for the specific user at the top of the page.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/UfzGBiopStyUorAtleot_devportalusersources.png\",\n        \"devportalusersources.png\",\n        \"691\",\n        \"360\",\n        \"#2e9d5b\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n#Viewing User Data\nBy clicking any of the available data sources for a user (highlighted in green), you can also view a graphic representation of the current data.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/tPb9wUmRsaQuSPS1LaVg_devportaluserdata.png\",\n        \"devportaluserdata.png\",\n        \"691\",\n        \"360\",\n        \"#30a658\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Manage Users via the Application API\"\n}\n[/block]\nAnother way to manage users is via the [Application API](doc:application-api)'s `/users` endpoint:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" https://api.humanapi.co/v1/apps/{clientId}/users\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n#Retrieve a Single User\n\nYou can retrieve a single app user by using this URL:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nReplace the `{clientId}` with the Client ID for your application, and `{humanId}` with the assigned Id for the specific user.\n\nUsing curl command line:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET -H 'Accept: application/json' \\\\\\n    -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\\\\n    https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users/0a34dca6b9fe0b2361038bd371d96539\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nExample User Payload\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"humanId\\\": \\\"0a34dca6b9fe0b2361038bd371d96539\\\",\\n  \\\"externalId\\\": \\\"sample.user1:::at:::example.com\\\",\\n  \\\"appId\\\": \\\"1d129c20acf6fcef9be0b067cc7859d872ed5ade\\\",\\n  \\\"createdAt\\\": \\\"2013-12-28T18:46:10.436Z\\\",\\n  \\\"updatedAt\\\": \\\"2013-12-29T05:05:50.601Z\\\"\\n}\\n\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"The returned payload will return the attribute \\\"appId\\\". `appId` is equivalent to `clientId` and is a prior naming convention that will be changed in the next major API release.\",\n  \"title\": \"appId == clientId\"\n}\n[/block]\n#Retrieve All Users\n\nTo retrieve all users, you can just query the `/users` endpoint itself:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET -H 'Accept: application/json' \\\\\\n    -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\\\\n    https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\n#Delete a User\nYou can delete a user by using this URL:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nReplace the `{clientId}` with the Client ID for your application, and `{humanId}` with the assigned Id.\n\n#Example\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X DELETE -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\\\\nhttps://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users/0a34dca6b9fe0b2361038bd371d96539\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\nThe response code for this is `204`\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"It is only recommended that you only delete a user when that user account is also deleted on your system. This will avoid potential Connect errors later on.\"\n}\n[/block]","excerpt":"","slug":"managing-users","type":"basic","title":"Managing Users"}
Users for your app are primarily created using the [Human Connect](doc:overview-of-human-connect) flow. Once you have users you can manage them with either the Developer Portal or the Application API. Both methods are described in detail below. [block:api-header] { "type": "basic", "title": "Managing Users via the Developer Portal" } [/block] One way to manage users is via the [Developer Portal](doc:developer-portal). From your app homepage, click the 'Users' section to see a list of your app's users. [block:image] { "images": [ { "image": [ "https://files.readme.io/vQNM4HGQQWi70BzRemBW_usersdevportal.png", "usersdevportal.png", "691", "360", "#3ca966", "" ] } ] } [/block] From this page, you can see the `humanId`, `Name`, `Email`, `accessToken`, and `publicToken` for a user. Under the Options column, you can do two things: - See or connect data sources for a user (blue bar icon) - Delete that user (red X icon) #Managing User Data Sources By clicking the blue bar icon in the Options column, you will be able to see what data sources that user has connected. Additionally, there will be a Human Connect button preconfigured for the specific user at the top of the page. [block:image] { "images": [ { "image": [ "https://files.readme.io/UfzGBiopStyUorAtleot_devportalusersources.png", "devportalusersources.png", "691", "360", "#2e9d5b", "" ] } ] } [/block] #Viewing User Data By clicking any of the available data sources for a user (highlighted in green), you can also view a graphic representation of the current data. [block:image] { "images": [ { "image": [ "https://files.readme.io/tPb9wUmRsaQuSPS1LaVg_devportaluserdata.png", "devportaluserdata.png", "691", "360", "#30a658", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "Manage Users via the Application API" } [/block] Another way to manage users is via the [Application API](doc:application-api)'s `/users` endpoint: [block:code] { "codes": [ { "code": " https://api.humanapi.co/v1/apps/{clientId}/users", "language": "http" } ] } [/block] #Retrieve a Single User You can retrieve a single app user by using this URL: [block:code] { "codes": [ { "code": "https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}", "language": "text" } ] } [/block] Replace the `{clientId}` with the Client ID for your application, and `{humanId}` with the assigned Id for the specific user. Using curl command line: [block:code] { "codes": [ { "code": "curl -X GET -H 'Accept: application/json' \\\n -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\n https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users/0a34dca6b9fe0b2361038bd371d96539", "language": "curl" } ] } [/block] Example User Payload [block:code] { "codes": [ { "code": "{\n \"humanId\": \"0a34dca6b9fe0b2361038bd371d96539\",\n \"externalId\": \"sample.user1@example.com\",\n \"appId\": \"1d129c20acf6fcef9be0b067cc7859d872ed5ade\",\n \"createdAt\": \"2013-12-28T18:46:10.436Z\",\n \"updatedAt\": \"2013-12-29T05:05:50.601Z\"\n}\n", "language": "json" } ] } [/block] [block:callout] { "type": "info", "body": "The returned payload will return the attribute \"appId\". `appId` is equivalent to `clientId` and is a prior naming convention that will be changed in the next major API release.", "title": "appId == clientId" } [/block] #Retrieve All Users To retrieve all users, you can just query the `/users` endpoint itself: [block:code] { "codes": [ { "code": "curl -X GET -H 'Accept: application/json' \\\n -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\n https://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users", "language": "text" } ] } [/block] #Delete a User You can delete a user by using this URL: [block:code] { "codes": [ { "code": "https://api.humanapi.co/v1/apps/{clientId}/users/{humanId}", "language": "text" } ] } [/block] Replace the `{clientId}` with the Client ID for your application, and `{humanId}` with the assigned Id. #Example [block:code] { "codes": [ { "code": "curl -X DELETE -u e7db255f4828e1d482743eba04faacb945ab7ca8: \\\nhttps://api.humanapi.co/v1/apps/1d129c20acf6fcef9be0b067cc7859d872ed5ade/users/0a34dca6b9fe0b2361038bd371d96539", "language": "curl" } ] } [/block] The response code for this is `204` [block:callout] { "type": "warning", "body": "It is only recommended that you only delete a user when that user account is also deleted on your system. This will avoid potential Connect errors later on." } [/block]