{"id":36296,"date":"2024-08-21T13:59:46","date_gmt":"2024-08-21T12:59:46","guid":{"rendered":"https:\/\/developers.ila.cegid.com\/valuekeep\/\/"},"modified":"2024-12-27T11:44:25","modified_gmt":"2024-12-27T10:44:25","slug":"webapi-how-to-get-the-tools-an-employee-has-access-to","status":"publish","type":"valuekeep","link":"https:\/\/developers.ila.cegid.com\/en\/valuekeep\/development-en\/transversal-en\/article\/webapi-how-to-get-the-tools-an-employee-has-access-to","title":{"rendered":"How to get the tools an employee has access to?"},"content":{"rendered":"<section class=\"av_textblock_section \"  itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock  '   itemprop=\"text\" ><div>It is possible to use a method to return the list of tools and their access level to which the employee has permission.<\/div>\n<h2>Method<\/h2>\n<div style=\"font-size: medium;\">The method returns the tool list and the access level the employee can access.<\/div>\n<div style=\"font-size: medium;\"><\/div>\n<div style=\"font-size: medium;\">The method to be used to get the tool list and the access level the employee can access is: <strong>GET <\/strong><b>\u00a0\/api\/mytenant\/myorganization\/settings\/assetsByUsers\/getToolsByUser?username=<span class=\"colour\" style=\"color: #00cbcc;\"><a href=\"mailto:user@domain.co\" target=\"_blank\" rel=\"noopener noreferrer\">user@domain.co<\/a><\/span><\/b><b style=\"color: #333333;\"><span class=\"font\" style=\"line-height: normal;\"><span class=\"size\" style=\"font-size: 16px;\"><span class=\"highlight sty__i7r22i__cls\"><span class=\"colour\" style=\"color: #00cbcc;\">m<\/span><\/span><\/span><\/span><\/b><b>&amp;modifiedOn=2020-11-20T09:55:33.396836+00:00&amp;maxRecords=100<\/b><\/div>\n<div style=\"font-size: medium;\"><\/div>\n<div style=\"font-size: medium;\"><span class=\"colour\" style=\"color: #515151;\">The method parameters are optional. If the parameter maxRecords is not specified, it returns a maximum of 100 records. The logic is the following<\/span><span class=\"colour\" style=\"color: #333333;\">:<\/span><\/div>\n<ul>\n<li><span class=\"colour\" style=\"color: #333333;\">username: returns all tools this employees has access to, this parameter should be the employee email.<\/span><\/li>\n<li>modifiedOn: returns all tools changed with a date after the introduced date.<\/li>\n<li>maxRecords: this parameter is used to place a limit to the data to be obtained. This parameter must be an integer, equal or inferior to 100.<\/li>\n<\/ul>\n<div style=\"font-size: medium;\"><span class=\"colour\" style=\"color: #333333;\">The server returns a HttpStatusCode.OK response, with the tool list and its access levels.<\/span><\/div>\n<div style=\"font-size: medium;\"><\/div>\n<div style=\"font-size: medium;\"><span class=\"colour\" style=\"color: #333333;\">The method data structure is the following:<\/span><\/div>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">\"accessLevels\":\r\n[\r\n\r\n{\r\n\r\n\r\n\"accessLevelId\": \"c1474504-aa6c-4a5c-b9c8-fa302195e3c7\",\r\n\r\n\r\n\"accessLevel\": \"G\",\u00a0\r\n\r\n\r\n\"acessLevelModifiedOn\":\"2020-11-20T09:55:33.396836+00:00\"\r\n\r\n}\r\n\r\n],\r\n\r\n\"equipmentKey\":\r\n\"MCH01\",\r\n\r\n\"description\":\r\n\"Machine #1\",\r\n\r\n\"id\":\r\n\"4133d120-7339-44b5-bafc-aad754f35f49\",\r\n\r\n\"isActive\":\r\ntrue,\r\n\r\n\"modifiedOn\":\r\n\"2020-11-20T09:55:33.396836+00:00\",\r\n\r\n\"isUpTime\":\r\ntrue,\r\n\r\n\"criticality\":\r\n000002,\r\n\r\n\"barcode\":\r\nnull,\r\n\r\n\"locationDesc\":\r\n\"Production Line #1\",\r\n\r\n\"location\":\r\n\"PROD01\",\r\n\r\n\"serial\":\r\n\"IU786TGFDE58\",\r\n\r\n\"responsible\":\r\n0001,\r\n\r\n\"brandDesc\":\r\n\"ASPECTTO\",\r\n\r\n\"brand\":\r\n\"ASPECTTO\",\r\n\r\n\"brandModelDesc\":\r\n\"TU4528\",\r\n\r\n\"brandModel\":\r\n\"TU4528\",\r\n\r\n\"familyDesc\":\r\nMachine,\r\n\r\n\"family\":\r\n0001,\r\n\r\n\"parentEquipment\":\r\nnull,\r\n\r\n\"parentEquipmentDesc\":\r\nnull,\r\n\r\n2.\u00a0\u00a0\u00a0\u00a0 \"externalReferencID\":\r\nnull,\r\n\r\n\"picture\":\r\n\"null\",\r\n\r\n\"pictureThumbnail\":\r\nnull,\r\n\r\n\"remarks\":\r\nnull,\r\n\r\n\"keyword\":\r\n\"Hand Drill\",\r\n\r\n\"exchangeRateDate\":\r\n\"0001-01-01T00:00:00\",\r\n\r\n\"exchangeRate\":\r\n0.0,\r\n\r\n\"baseCurrency\":\r\nnull,\r\n\r\n\"company\":\r\n\"Demonstration Company\",\r\n\r\n\"isDisposed\":\r\nfalse,\r\n\r\n\"currency\":\r\n\"British pound\",\r\n\r\n\"reportingCurrency\":\r\nnull\r\n\r\n}<\/pre>\n<\/div>\n<div>\n<div>\n<div>On the modifiedOn parameter you must consider the html encoding, the &#8220;+&#8221; is replaced by &#8220;%2b&#8221;.<\/div>\n<div><strong>Note<\/strong>: If the inserted date on the &#8220;modifiedOn&#8221; search parameter is superior or equal to the &#8220;acessLevelModifiedOn&#8221; date, it will present the value &#8220;0001-01-01T00:00:00+00:00&#8221;.<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<\/div><\/section>\n","protected":false},"excerpt":{"rendered":"","protected":false},"featured_media":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","tags":[895,916],"videos_tax":[],"post-type":[],"categoria-valuekeep":[947],"class_list":["post-36296","valuekeep","type-valuekeep","status-publish","format-standard","hentry","tag-employees","tag-tools","categoria-valuekeep-transversal-en"],"_links":{"self":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/valuekeep\/36296","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/valuekeep"}],"about":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/types\/valuekeep"}],"replies":[{"embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/comments?post=36296"}],"version-history":[{"count":0,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/valuekeep\/36296\/revisions"}],"wp:attachment":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/media?parent=36296"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/tags?post=36296"},{"taxonomy":"videos_tax","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/videos_tax?post=36296"},{"taxonomy":"post-type","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/post-type?post=36296"},{"taxonomy":"categoria-valuekeep","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/categoria-valuekeep?post=36296"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}