{"id":399,"date":"2020-04-30T06:38:17","date_gmt":"2020-04-30T06:38:17","guid":{"rendered":"https:\/\/senitron.net\/developers\/?page_id=399"},"modified":"2020-04-30T10:17:02","modified_gmt":"2020-04-30T10:17:02","slug":"restapi-inventory-upload","status":"publish","type":"page","link":"https:\/\/senitron.net\/developers\/restapi-inventory-upload\/","title":{"rendered":"RESTAPI-Inventory Upload"},"content":{"rendered":"<div class=\"fusion-fullwidth fullwidth-box fusion-builder-row-1 nonhundred-percent-fullwidth non-hundred-percent-height-scrolling\" style=\"--awb-border-radius-top-left:0px;--awb-border-radius-top-right:0px;--awb-border-radius-bottom-right:0px;--awb-border-radius-bottom-left:0px;--awb-flex-wrap:wrap;\" ><div class=\"fusion-builder-row fusion-row\"><div class=\"fusion-layout-column fusion_builder_column fusion-builder-column-0 fusion_builder_column_1_1 1_1 fusion-one-full fusion-column-first fusion-column-last\" style=\"--awb-bg-size:cover;\"><div class=\"fusion-column-wrapper fusion-column-has-shadow fusion-flex-column-wrapper-legacy\"><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-separator fusion-full-width-sep\" style=\"margin-left: auto;margin-right: auto;margin-top:0px;margin-bottom:0px;width:100%;\"><div class=\"fusion-separator-border sep-single sep-solid\" style=\"--awb-height:20px;--awb-amount:20px;border-color:#e2e2e2;border-top-width:2px;\"><\/div><\/div><div class=\"fusion-sep-clear\"><\/div><div class=\"fusion-text fusion-text-1\"><p><span class=\"redtextcolor\">Service Name<\/span><span class=\"textindentlevel1\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 Inventory Upload<\/span><br \/><span class=\"redtextcolor\">Service Method<\/span><span class=\"textindentlevel1\"> \u00a0 \u00a0 \u00a0\u00a0\u00a0 POST<\/span><br \/><span class=\"redtextcolor\">Service URL<\/span><span class=\"textindentlevel1\"> \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \/inventories\/upload<\/span><\/p>\n<p><span class=\"redtextcolor\">Request Header Fields<\/span><br \/><span class=\"greentextcolor\">Content-Type = <span class=\"cyantextcolor\">application\/json<\/span><br \/><span class=\"greentextcolor\">Authorization = &lt;<span class=\"cyantextcolor\">token<\/span>&gt;<\/span><\/span><\/p>\n<p><span class=\"darkbluetextcolor\">Request Body Data (JSON)<\/span><br \/>{<br \/><span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">zone<\/span>\": {<\/span><br \/><span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">id<\/span>\": &lt;<span class=\"cyantextcolor\">zone id<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">name<\/span>\": \"&lt;<span class=\"cyantextcolor\">zone name<\/span>&gt;\"<\/span><br \/><span class=\"textindentlevel1\">},<br \/>\"<span class=\"greentextcolor\">location<\/span>\": \"<span class=\"cyantextcolor\">location code<\/span>&gt;\",<br \/>\"<span class=\"greentextcolor\">categories<\/span>\": [<\/span><br \/><span class=\"textindentlevel2\">{<\/span><br \/><span class=\"textindentlevel3\">\"<span class=\"greentextcolor\">id<\/span>\": &lt;<span class=\"cyantextcolor\">category id<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">name<\/span>\": \"&lt;<span class=\"cyantextcolor\">category name<\/span>&gt;\"<\/span><br \/><span class=\"textindentlevel2\">}<\/span><br \/><span class=\"textindentlevel1\">],<br \/>\"<span class=\"greentextcolor\">unique_epc<\/span>\": &lt;<span class=\"cyantextcolor\">unique epc status<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">override_quantity<\/span>\": &lt;<span class=\"cyantextcolor\">override quantity status<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">override_quantity_by_zone<\/span>\": &lt;<span class=\"cyantextcolor\">override quantity by zone status<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">override_quantity_by_category<\/span>\": &lt;<span class=\"cyantextcolor\">override quantity by category<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">append_to_last_session<\/span>\": &lt;<span class=\"cyantextcolor\">append this data to last session data status<\/span>&gt;,<br \/>\"<span class=\"greentextcolor\">last_session_date<\/span>\": \"&lt;<span class=\"cyantextcolor\">last session date<\/span>&gt;\",<br \/>\"<span class=\"greentextcolor\">items<\/span>\":[<\/span><br \/><span class=\"textindentlevel2\">{<\/span><br \/><span class=\"textindentlevel3\">\"<span class=\"greentextcolor\">epc<\/span>\": \"&lt;<span class=\"cyantextcolor\">epc<\/span>&gt;\",<br \/>\"<span class=\"greentextcolor\">datetime<\/span>\": \"&lt;<span class=\"cyantextcolor\">datetime of reading epc<\/span>&gt;\",<br \/>\"<span class=\"greentextcolor\">zone_name<\/span>\": \"&lt;<span class=\"cyantextcolor\">zone name<\/span>&gt;\"<\/span><br \/><span class=\"textindentlevel2\">},<br \/>...<\/span><br \/><span class=\"textindentlevel1\">]<\/span><br \/>}<\/p>\n<p>Note:<br \/>Location and zone are required<\/p>\n<p><span class=\"darkbluetextcolor\">Response Data (JSON) <\/span><br \/><span class=\"greentextcolor\">Status code = 200<\/span><\/p>\n<p>{<br \/><span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">message<\/span>\" : \"&lt;<span class=\"cyantextcolor\">a successful message<\/span>&gt;\"<\/span><br \/>}<\/p>\n<p>\u00a0<\/p>\n<p><span class=\"graytextcolor\">Example<\/span><br \/><span class=\"blacktextcolor\">POST: http:\/\/app.senitron.net\/api\/v1\/inventories\/upload<\/span><br \/>{<br \/><span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">zone<\/span>\": {<\/span><br \/><span class=\"textindentlevel2\">\"<span class=\"greentextcolor\">id<\/span>\": <span class=\"cyantextcolor\">1<\/span>,<br \/>\"<span class=\"greentextcolor\">name<\/span>\": \"<span class=\"cyantextcolor\">Building 1 Staging<\/span>\"<\/span><br \/><span class=\"textindentlevel1\">},<br \/>\"<span class=\"greentextcolor\">location<\/span>\": \"<span class=\"cyantextcolor\">001<\/span>\",<br \/>\"<span class=\"greentextcolor\">categories<\/span>\": [<\/span><br \/><span class=\"textindentlevel2\">{<\/span><br \/><span class=\"textindentlevel3\">\"<span class=\"greentextcolor\">id<\/span>\": <span class=\"cyantextcolor\">376519<\/span>,<br \/>\"<span class=\"greentextcolor\">name<\/span>\": \"<span class=\"cyantextcolor\">cat1<\/span>\"<\/span><br \/><span class=\"textindentlevel2\">}<\/span><br \/><span class=\"textindentlevel1\">],<br \/>\"<span class=\"greentextcolor\">unique_epc<\/span>\": <span class=\"cyantextcolor\">true<\/span>,<br \/>\"<span class=\"greentextcolor\">override_quantity<\/span>\": <span class=\"cyantextcolor\">false<\/span>,<br \/>\"<span class=\"greentextcolor\">override_quantity_by_zone<\/span>\": <span class=\"cyantextcolor\">false<\/span>,<br \/>\"<span class=\"greentextcolor\">override_quantity_by_category<\/span>\": <span class=\"cyantextcolor\">true<\/span>,<br \/>\"<span class=\"greentextcolor\">append_to_last_session<\/span>\": <span class=\"cyantextcolor\">true<\/span>,<br \/>\"<span class=\"greentextcolor\">last_session_date<\/span>\": \"<span class=\"cyantextcolor\">2020-01-16T20:06:18+4:00:00.000000<\/span>\",<br \/>\"<span class=\"greentextcolor\">items<\/span>\":[<\/span><br \/><span class=\"textindentlevel2\">{<\/span><br \/><span class=\"textindentlevel3\">\"<span class=\"greentextcolor\">epc<\/span>\": \"<span class=\"cyantextcolor\">CF00000216C84C400000000D<\/span>\",<br \/>\"<span class=\"greentextcolor\">datetime<\/span>\": \"<span class=\"cyantextcolor\">2020-01-16T20:06:18+4:00:00.000000<\/span>\",<br \/>\"<span class=\"greentextcolor\">zone_name<\/span>\": \"<span class=\"cyantextcolor\">Building 1 Staging<\/span>\"<\/span><br \/><span class=\"textindentlevel2\">},<br \/>{<\/span><br \/><span class=\"textindentlevel3\">\"<span class=\"greentextcolor\">epc<\/span>\": \"<span class=\"cyantextcolor\">CF00000216C84C800000000D<\/span>\",<br \/>\"<span class=\"greentextcolor\">datetime<\/span>\": \"<span class=\"cyantextcolor\">2020-01-16T20:06:18+4:00:00.000000<\/span>\",<br \/>\"<span class=\"greentextcolor\">zone_name<\/span>\": \"<span class=\"cyantextcolor\">Building 1 Staging<\/span>\"<\/span><br \/><span class=\"textindentlevel2\">}<\/span><br \/><span class=\"textindentlevel1\">]<\/span><br \/>}<\/p>\n<p><span class=\"darkbluetextcolor\">Response Data (JSON) <\/span><br \/><span class=\"greentextcolor\">Status code = 200<\/span><\/p>\n<p>{<br \/><span class=\"textindentlevel1\">\"<span class=\"greentextcolor\">message<\/span>\" : \"<span class=\"cyantextcolor\">All epcs are saved in inventory<\/span>\"<\/span><br \/>}<\/p>\n<\/div><div class=\"fusion-clearfix\"><\/div><\/div><\/div><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"side-navigation.php","meta":{"footnotes":""},"class_list":["post-399","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages\/399","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/comments?post=399"}],"version-history":[{"count":0,"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/pages\/399\/revisions"}],"wp:attachment":[{"href":"https:\/\/senitron.net\/developers\/wp-json\/wp\/v2\/media?parent=399"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}