{"id":97,"date":"2023-04-10T16:47:40","date_gmt":"2023-04-10T16:47:40","guid":{"rendered":"https:\/\/www.wellnessliving.com\/developer-portal\/?p=97"},"modified":"2024-10-29T19:18:45","modified_gmt":"2024-10-29T19:18:45","slug":"finding-user-information","status":"publish","type":"post","link":"https:\/\/www.wellnessliving.com\/developer-portal\/tutorials\/finding-user-information\/","title":{"rendered":"Finding user information"},"content":{"rendered":"\n<p><div class=\"note\"><strong>Note<\/strong>A user\u2019s identifier or key (the <span class=\"coding_type\">uid<\/span>) is a very important piece of information. It\u2019s used by several endpoints to identify users. When managing user information in WellnessLiving, keep in mind that a user\u2019s last name and email are optional when client profiles are created by staff members. As a result, not every user has all this information set in their profile. However, a client profile will always have an associated <span class=\"coding_type\">uid<\/span>.<\/div><\/p>\n\n\n\n<p>There are two primary methods for finding an existing user and their <span class=\"coding_type\">uid<\/span> in the system. The first method uses the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.wellnessliving.com\/knowledge-sharing\/knowledge-base\/all-clients-report\/\" target=\"_blank\">All Clients Report<\/a> to retrieve all clients in a business. This report returns a client\u2019s name, email, and client ID (<span class=\"coding_type\">uid<\/span>).<\/p>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Retrieve the All Clients Report.\n$o_report=new \\WellnessLiving\\Wl\\Report\\DataModel($o_config);\n$o_report->cookieSet($o_notepad->cookieGet()); \/\/ Store cookies to maintain the session.\n$o_report->id_report=WlReportSid::LOGIN_LIST_ALL;\n$o_report->k_business='3'; \/\/ Put your business key here.\n\n$o_report->get();\n\n\/\/ Output the information.\n$i=0;\nforeach($o_report->a_data['a_row'] as $a_row)\n{\n $i++;\n printf(\"%3d %3s %15s %15s %s \\r\\n\",$i,$a_row['uid'],$a_row['a_data_api']['s_firstname'],$a_row['a_data_api']['s_lastname'],$a_row['a_data_api']['s_mail']);\n}<\/pre>\n\n\n\n<p>The second method involves a more limited search using the <a href=\"https:\/\/github.com\/wellnessliving\/wl-sdk\/blob\/4824da8d0857174d96cdc9d62d50701bea703912\/WellnessLiving\/Wl\/Login\/Search\/StaffApp\/ListModel.php\" target=\"_blank\" rel=\"noreferrer noopener\">ListModel<\/a> endpoint. This endpoint takes a name (or fragment of a name) and returns all matches in a business.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Search for a user.\n$o_search_model = new \\WellnessLiving\\Wl\\Login\\Search\\StaffApp\\ListModel($o_config);\n$o_search_model->cookieSet($o_notepad->cookieGet()); \/\/ Store cookies to maintain the session.\n\n$o_search_model->k_business='3';\n$o_search_model->text_search='example';\n$o_search_model->uid='8'; \/\/ The UID of the user performing the search.\n\n\/\/ Perform the request.\n$o_search_model->get();\n\nforeach($o_search_model->a_list as $a_list)\n{\n echo $a_list['uid'].' '.$a_list['text_title'].\"\\n\";\n}<\/pre>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>A user\u2019s identifier or key (the uid) is a very important piece of information. It\u2019s used by several endpoints to identify users. When managing user information in WellnessLiving, keep in mind that a user\u2019s last name and email are optional when client profiles are created by staff members. As a result, not every user has [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,35],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/97"}],"collection":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":11,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":483,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/97\/revisions\/483"}],"wp:attachment":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}