{"id":22683,"date":"2019-11-01T11:05:46","date_gmt":"2019-11-01T11:05:46","guid":{"rendered":"https:\/\/developer.kore.ai\/v8-0\/?p=22683"},"modified":"2021-03-25T08:36:52","modified_gmt":"2021-03-25T08:36:52","slug":"get-user-api","status":"publish","type":"post","link":"https:\/\/developer.kore.ai\/v8-0\/docs\/bots\/api-guide\/get-user-api\/","title":{"rendered":"Get User Information"},"content":{"rendered":"<section class=\"l-section wpb_row height_auto\"><div class=\"l-section-h i-cf\"><div class=\"g-cols vc_row type_default valign_top\"><div class=\"vc_col-sm-12 wpb_column vc_column_container\"><div class=\"vc_column-inner\"><div class=\"wpb_wrapper\">\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<p>To retrieve the user details.<\/p>\n<p class=\"note\">This API requires JWT generated by an application created only from Bot Admin Console.<br \/>\nTo use this API, app needs the Admin API Scope of <em>User Management<\/em> under <em>Security &amp; Control<\/em>.<\/p>\n<p><b>POST <\/b><code>https:\/\/{{host}}\/api\/public\/usersInfo<\/code><\/p>\n<p>NOTE: This feature was introduced in ver7.1 of the platform.<\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Query_Parameters\">Query Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>host<\/td>\n<td>Environment URL, for example, https:\/\/bots.kore.ai<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Body_Parameters\">Body Parameters<\/span><\/h3>\n<table>\n<tbody>\n<tr>\n<th>Parameter<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>emailIds<\/p>\n<p>or <span style=\"font-weight: 400\">orgUserIds<\/span><\/td>\n<td>The array of email or org user id for each user whose information is sought<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Authorization\">Authorization<\/span><\/h3>\n<p>Invoke the API with JWT in the header with the following syntax:<\/p>\n<p><code>auth: {{JWT}}<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Response_Content_Type\">Response Content Type<\/span><\/h3>\n<p><code>application\/json<\/code><\/p>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Request\">Sample Request<\/span><\/h3>\n<pre>curl -X POST \\\r\n  https:\/\/{{host}}\/api\/public\/usersInfo \\\r\n  -H 'Content-Type: application\/json' \\\r\n  -H 'auth: YOUR_JWT_ACCESS_TOKEN' \\\r\n  -d '{\r\n    \"emailIds\"\/\"<span style=\"font-weight: 400\">orgUserIds<\/span>\": [\r\n        \"publicuser3@gmail.com\",\r\n        \"test@test.com\"\r\n    ]\r\n}'<\/pre>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div>\r\n\t<div class=\"wpb_text_column \">\r\n\t\t<div class=\"wpb_wrapper\">\r\n\t\t\t<h3><span class=\"ez-toc-section\" id=\"Sample_Response\">Sample Response<\/span><\/h3>\n<ul>\n<li>For success case:\n<pre>[\r\n    {\r\n        \"canCreateBot\": true,\r\n        \"isDeveloper\": true,\r\n        \"userInfo\": {\r\n            \"emailId\": \"publicuser3@gmail.com\",\r\n            \"userId\": \"u-575f16b0-c4c5-5f3c-a740-06288c67dec1\",\r\n            \"firstName\": \"\",\r\n            \"lastName\": \"\"\r\n        },\r\n        \"roles\": {\r\n            \"btRoles\": [\r\n                {\r\n                    \"roleId\": \"5d9d920dabdc1e6e8ec99342\",\r\n                    \"roleName\": \"sample bot role 2\",\r\n                    \"groups\": [],\r\n                    \"botId\": \"st-16511425-15c5-5cdf-b652-a796db7d134b\",\r\n                    \"botName\": \"bot6ent\"\r\n                },\r\n                {\r\n                    \"roleId\": \"5bb1ef53e6519fa9f722e69b\",\r\n                    \"roleName\": \"Bot Tester\",\r\n                    \"groups\": [\r\n                        \"group1\"\r\n                    ],\r\n                    \"botId\": \"st-ac60188d-cdf4-5e58-a249-178e54cd85b7\",\r\n                    \"botName\": \"dashboardtest\"\r\n                },\r\n                {\r\n                    \"roleId\": \"5d9d8db30d54920a8df1e68b\",\r\n                    \"roleName\": \"sample bot role1\",\r\n                    \"groups\": [],\r\n                    \"botId\": \"st-b8525f88-6dd3-54a7-8a97-734ecb748733\",\r\n                    \"botName\": \"bot5ent\"\r\n                }\r\n            ],\r\n            \"adminRoles\": [\r\n                {\r\n                    \"roleId\": \"5cd4081158217217cccabb7e\",\r\n                    \"roleName\": \"admin\",\r\n                    \"groups\": []\r\n                },\r\n                {\r\n                    \"roleId\": \"5d9d8d930d54920a8df1e689\",\r\n                    \"roleName\": \"sample admin role1\",\r\n                    \"groups\": []\r\n                }\r\n            ]\r\n        },\r\n        \"assignBotTasks\": [\r\n            {\r\n                \"botId\": \"st-xxxxx-xxx-xxx-xxx-xxxxx\",\r\n                \"dialogs\": [\r\n                    \"dg-xxxxx-xxx-xxx-xxx-xxxxx\"\r\n                ],\r\n                \"actions\": [],\r\n                \"alerts\": [],\r\n                \"knowledgeTask\": []\r\n            }\r\n        ],\r\n        \"groups\": [\r\n            {\r\n                \"groupId\": \"e-06b41cdd-7678-5394-b958-40ca5662f502\",\r\n                \"groupName\": \"group1\"\r\n            }\r\n        ]\r\n    },\r\n    {\r\n        \"userInfo\": {\r\n            \"emailId\": \"test@test.com\",\r\n            \"status\": \"failure\",\r\n            \"reason\": \"Invalid emailId\"\r\n        }\r\n    }\r\n]\r\n<\/pre>\n<\/li>\n<li>Failure case:\n<pre>    {\r\n        \"userInfo\": {\r\n            \"emailId\": \"test@test.com\",\r\n            \"status\": \"failure\",\r\n            \"reason\": \"Invalid emailId\"\r\n        }\r\n    }\r\n<\/pre>\n<\/li>\n<\/ul>\n\r\n\t\t<\/div>\r\n\t<\/div>\r\n<div class=\"w-separator size_small with_line width_default thick_1 style_solid color_border align_center\"><div class=\"w-separator-h\"><\/div><\/div><\/div><\/div><\/div><\/div><\/div><\/section>\n","protected":false},"excerpt":{"rendered":"To retrieve the user details. This API requires JWT generated by an application created only from Bot Admin Console. To use this API, app needs the Admin API Scope of User Management under Security &amp; Control. POST https:\/\/{{host}}\/api\/public\/usersInfo NOTE: This feature was introduced in ver7.1 of the platform. Query Parameters Parameter Description host Environment URL,...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-22683","post","type-post","status-publish","format-standard","hentry","category-api-guide"],"_links":{"self":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/comments?post=22683"}],"version-history":[{"count":7,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22683\/revisions"}],"predecessor-version":[{"id":23415,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/posts\/22683\/revisions\/23415"}],"wp:attachment":[{"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/media?parent=22683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/categories?post=22683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developer.kore.ai\/v8-0\/wp-json\/wp\/v2\/tags?post=22683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}