{"__v":3,"_id":"564d1afc4567342100ad96c5","category":{"__v":1,"_id":"564d1af94567342100ad96b0","pages":["564d1afc4567342100ad96c4","564d1afc4567342100ad96c5","564d1afc4567342100ad96c6"],"project":"551375e1d04af219007ddc52","version":"564d1af84567342100ad96aa","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":1,"_id":"564d1af84567342100ad96aa","project":"551375e1d04af219007ddc52","createdAt":"2015-11-19T00:42:32.705Z","releaseDate":"2015-11-19T00:42:32.705Z","categories":["564d1af94567342100ad96ab","564d1af94567342100ad96ac","564d1af94567342100ad96ad","564d1af94567342100ad96ae","564d1af94567342100ad96af","564d1af94567342100ad96b0","564d1af94567342100ad96b1","564d1af94567342100ad96b2"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.1.0","version":"1.1"},"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/IaoC0qOGSB6a4lZD0KSQ_Screen%20Shot%202016-05-31%20at%204.32.28%20PM.png\",\n        \"Screen Shot 2016-05-31 at 4.32.28 PM.png\",\n        \"1392\",\n        \"821\",\n        \"#5994d4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nFrom this page, you can see the `humanId`, `ExternalId`, `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 on the user's humanId, 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 to allow you to connect directly in the Developer Portal.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/oRvESlhKTCKKq2ELTT9b_Screen%20Shot%202016-05-31%20at%204.37.33%20PM.png\",\n        \"Screen Shot 2016-05-31 at 4.37.33 PM.png\",\n        \"1392\",\n        \"821\",\n        \"#548ec4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n#Viewing User Data\nBy clicking any of the available data sources for a user, 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/yB3fpoRT8CJAEfQGpQQ9_Screen%20Shot%202016-05-31%20at%204.36.18%20PM.png\",\n        \"Screen Shot 2016-05-31 at 4.36.18 PM.png\",\n        \"1392\",\n        \"821\",\n        \"#5a97d9\",\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/IaoC0qOGSB6a4lZD0KSQ_Screen%20Shot%202016-05-31%20at%204.32.28%20PM.png", "Screen Shot 2016-05-31 at 4.32.28 PM.png", "1392", "821", "#5994d4", "" ] } ] } [/block] From this page, you can see the `humanId`, `ExternalId`, `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 on the user's humanId, 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 to allow you to connect directly in the Developer Portal. [block:image] { "images": [ { "image": [ "https://files.readme.io/oRvESlhKTCKKq2ELTT9b_Screen%20Shot%202016-05-31%20at%204.37.33%20PM.png", "Screen Shot 2016-05-31 at 4.37.33 PM.png", "1392", "821", "#548ec4", "" ] } ] } [/block] #Viewing User Data By clicking any of the available data sources for a user, you can also view a graphic representation of the current data. [block:image] { "images": [ { "image": [ "https://files.readme.io/yB3fpoRT8CJAEfQGpQQ9_Screen%20Shot%202016-05-31%20at%204.36.18%20PM.png", "Screen Shot 2016-05-31 at 4.36.18 PM.png", "1392", "821", "#5a97d9", "" ] } ] } [/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]