{"id":36295,"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:41:50","modified_gmt":"2024-12-27T10:41:50","slug":"webapi-how-to-get-the-equipment-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-equipment-an-employee-has-access-to","title":{"rendered":"How to obtain the equipment to which an employee has access?"},"content":{"rendered":"<section class=\"av_textblock_section \"  itemscope=\"itemscope\" itemtype=\"https:\/\/schema.org\/CreativeWork\" ><div class='avia_textblock  '   itemprop=\"text\" ><p>It is possible to use a method to return the list of equipment and its access level to which the employee has permission.<\/p>\n<h2>Method<\/h2>\n<div>The method returns the equipment list and the access level the employee has access to.<\/div>\n<p>The method to be used to get the equipment list and the access level the employee has access to is: <b>GET <\/b><b>\u00a0\/api\/mytenant\/myorganization\/settings\/assetsByUsers\/getEquipmentByUser?username=<a href=\"mailto:user@domain.com\" target=\"_blank\" rel=\"noopener noreferrer\">user@domain.com<\/a>&amp;modifiedOn=2020-11-20T09:55:33.396836+00:00&amp;maxRecords=100<\/b><\/p>\n<div><\/div>\n<p>The method parameters are optional. If the parameter maxRecords is not specified, it returns a maximum of 100 records. The logic is the following:<\/p>\n<ol>\n<li>username: returns all the equipment this employee has access to, this parameter should be the employee email.<\/li>\n<li>modifiedOn: returns all the equipment 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<\/ol>\n<div>The server returns a HttpStatusCode.OK response, with the equipment list and its access levels.<\/div>\n<div><\/div>\n<div>The method data structure is the following:<\/div>\n<div>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\">\"accessLevels\":\r\n[\r\n\r\n{\r\n\r\n\u00a0 \"accessLevelId\":\r\n\"c1474504-aa6c-4a5c-b9c8-fa302195e3c7\",\r\n\r\n\u00a0 \"accessLevel\": \"G\",\r\n\u00a0 \"acessLevelModifiedOn\":\"2020-11-20T09:55:33.396836+00:00\"\r\n\r\n}\r\n\r\n],\r\n\r\n\"equipmentKey\": \"MCH01\",\r\n\r\n\"description\": \"Machine #1\",\r\n\r\n\"id\":\r\n\"4133d120-7339-44b5-bafc-aad754f35f49\",\r\n\r\n\"isActive\": true,\r\n\r\n\"modifiedOn\":\r\n\"2020-11-20T09:55:33.396836+00:00\",\r\n\r\n\"isUpTime\": true,\r\n\r\n\"criticality\": 000002,\r\n\r\n\"barcode\": null,\r\n\r\n\"locationDesc\": \"Production Line #1\",\r\n\r\n\"location\": \"PROD01\",\r\n\r\n\"serial\": \"IU786TGFDE58\",\r\n\r\n\"responsible\": 0001,\r\n\r\n\"brandDesc\": \"ASPECTTO\",\r\n\r\n\"brand\": \"ASPECTTO\",\r\n\r\n\"brandModelDesc\": \"TU4528\",\r\n\r\n\"brandModel\": \"TU4528\",\r\n\r\n\"familyDesc\": Machine,\r\n\r\n\"family\": 0001,\r\n\r\n\"parentEquipment\": null,\r\n\r\n\"parentEquipmentDesc\": null\r\n\r\n2.\r\n\"externalReferencID\":\r\nnull,\r\n\r\n\"picture\": \"null\",\r\n\r\n\"pictureThumbnail\": null,\r\n\r\n\"remarks\": null,\r\n\r\n\"keyword\": \"Multi Split Ar114986\",\r\n\r\n\"exchangeRateDate\": \"0001-01-01T00:00:00\",\r\n\r\n\"exchangeRate\": 0.0,\r\n\r\n\"baseCurrency\": null,\r\n\r\n\"company\": \"Demonstration Company\",\r\n\r\n\"isDisposed\": false,\r\n\r\n\"reportingCurrency\": null,\r\n\r\n\"currency\": \"British pound\"\r\n\r\n}<\/pre>\n<\/div>\n<div>\n<div>\n<p><strong>Notes<\/strong>:<\/p>\n<ul>\n<li>On the modifiedOn parameter it will be necessary to have the html encoding into account, the &#8220;+&#8221; is replaced by &#8220;%2b&#8221;.<\/li>\n<li>f 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;.<\/li>\n<\/ul>\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,915],"videos_tax":[],"post-type":[],"categoria-valuekeep":[947],"class_list":["post-36295","valuekeep","type-valuekeep","status-publish","format-standard","hentry","tag-employees","tag-equipment","categoria-valuekeep-transversal-en"],"_links":{"self":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/valuekeep\/36295","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=36295"}],"version-history":[{"count":0,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/valuekeep\/36295\/revisions"}],"wp:attachment":[{"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/media?parent=36295"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/tags?post=36295"},{"taxonomy":"videos_tax","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/videos_tax?post=36295"},{"taxonomy":"post-type","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/post-type?post=36295"},{"taxonomy":"categoria-valuekeep","embeddable":true,"href":"https:\/\/developers.ila.cegid.com\/en\/wp-json\/wp\/v2\/categoria-valuekeep?post=36295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}