{"id":766,"date":"2022-06-18T17:43:03","date_gmt":"2022-06-18T17:43:03","guid":{"rendered":"https:\/\/codenerix.com\/?p=766\/"},"modified":"2023-04-06T06:26:24","modified_gmt":"2023-04-06T06:26:24","slug":"codenerix-api","status":"publish","type":"post","link":"https:\/\/codenerix.com\/en\/codenerix-api\/","title":{"rendered":"CODENERIX API"},"content":{"rendered":"\n<p>In this article, you will learn how does work <strong><span style=\"color: #343433;\"><strong><a href=\"https:\/\/github.com\/codenerix\/django-codenerix\"><span style=\"color: #343433;\">CODE<\/span><span style=\"color: #70a8e0;\">NERIX<\/span><\/a><\/strong><\/span><\/strong> <strong>API<\/strong>.<\/p>\n\n\n\n<p>Since all the operations between the front and back end are happening through <strong>JSON<\/strong> communication, it is easy to think there is a protocol behind all of that. In fact, there is a <strong>RESTful<\/strong> <strong>API<\/strong> based on <strong>JSON<\/strong> to manage everything that is happening inside <strong><span style=\"color: #343433;\"><strong><a href=\"https:\/\/github.com\/codenerix\/django-codenerix\"><span style=\"color: #343433;\">CODE<\/span><span style=\"color: #70a8e0;\">NERIX<\/span><\/a><\/strong><\/span><\/strong>.<\/p>\n\n\n\n<p>Actually, not everything happens on <strong>JSON<\/strong>. Forms are rendered on the server side and verified on the user side, but you can also enable the <strong>RESTful API<\/strong> for those.<\/p>\n\n\n\n<p>The explanations below are for public view. If you would like to use those with protected views (the ones requiring a logged-in user), read &#8220;<a href=\"https:\/\/codenerix.com\/en\/authentication-system\/\"><strong><span style=\"color: #343433;\"><strong><span style=\"color: #343433;\">CODE<\/span><span style=\"color: #70a8e0;\">NERIX<\/span><\/strong><\/span><\/strong> Authentication System<\/a>&#8220;.<\/p>\n\n\n\n<p>There are several ways to make <strong><span style=\"color: #343433;\"><strong><a href=\"https:\/\/github.com\/codenerix\/django-codenerix\"><span style=\"color: #343433;\">CODE<\/span><span style=\"color: #70a8e0;\">NERIX<\/span><\/a><\/strong><\/span><\/strong> work fully as a <strong>REST<\/strong> service:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Any view can work as a <strong>REST<\/strong> service just by enabling the &#8220;<strong>json<\/strong>&#8221; attribute on that view:<br><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">json = True<\/code><br><br><strong>GenCreate<\/strong>, <strong>GenUpdate<\/strong>, <strong>GenDetail,<\/strong> and <strong>GenDelete<\/strong> also support &#8220;<strong>json_details<\/strong>&#8220;, which will return extra information about field types, mandatory fields, and restrictions:<br><code data-enlighter-language=\"python\" class=\"EnlighterJSRAW\">json_details = True<\/code><\/li>\n\n\n\n<li>Any <strong>GET<\/strong> request that specifies that it wants a <strong>JSON<\/strong> answer using &#8220;<strong>force_rest_api=1<\/strong>&#8221; as a <strong>GET<\/strong> parameter in the <strong>URL<\/strong><\/li>\n\n\n\n<li>Any <strong>POST<\/strong> request that includes a &#8220;<strong>json<\/strong>&#8221; parameter<\/li>\n\n\n\n<li>In <strong>GenList,<\/strong> if method <strong>json_builder()<\/strong> exists.<\/li>\n\n\n\n<li>Any request that includes an HTTP &#8220;<strong>X-HTTP-REST<\/strong>&#8221; header (this is the most comfortable way to use REST)<\/li>\n\n\n\n<li>There are basic actions like GET operation on lists that will return JSON naturally<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>NOTES:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>POST<\/strong> operations on <strong>forms<\/strong> will accept <strong>JSON<\/strong> but will answer with a rendered form, except that any of the above is in action.<\/li>\n\n\n\n<li>Any request with an &#8216;<strong>x-requested-with<\/strong>&#8216; parameter set to &#8216;<strong>XMLHttpRequest<\/strong>&#8216; will be threaded as an <strong>XHR request<\/strong> and processed as it is, not as a <strong>REST request<\/strong>.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<p>The basic actions you can perform on any URL are mostly based on the nature of that URL. We recommend exploring the <strong>XHR panel<\/strong> from your browser to understand what information provides what service.<\/p>\n\n\n\n<p>Valid methods:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>GenList:\n<ul class=\"wp-block-list\">\n<li>GET: get the list of data<\/li>\n\n\n\n<li>POST: works as &#8220;<strong>add<\/strong>&#8220;, &#8220;<strong>create<\/strong>&#8220;, or &#8220;<strong>new<\/strong>&#8220;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>GenDetail:\n<ul class=\"wp-block-list\">\n<li>GET: get details from a register<\/li>\n\n\n\n<li>PUT: works as an &#8220;<strong>edit<\/strong>&#8221; or &#8220;<strong>update<\/strong>&#8221; operation<\/li>\n\n\n\n<li>DELETE: works as a &#8220;<strong>delete<\/strong>&#8221; operation<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>GenDelete:\n<ul class=\"wp-block-list\">\n<li>POST: works as a &#8220;<strong>delete<\/strong>&#8220;<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Examples<\/h2>\n\n\n\n<p>For a table that looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/codenerix_list-1024x296.png\" alt=\"\" class=\"wp-image-743\" width=\"820\" height=\"237\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">GenList &#8211; GET<\/h3>\n\n\n\n<p>An empty GET over a GenList will return exactly that information:  <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">  [ \/geodata\/continents ]<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\t\"meta\": {\n\t\t\"getval\": {},\n\t\t\"username\": \"xxxxxxxx\",\n\t\t\"context\": {},\n\t\t\"url_media\": \"\/media\/\",\n\t\t\"url_static\": \"\/static\/\",\n\t\t\"page\": 1,\n\t\t\"pages\": [1],\n\t\t\"pages_to_bring\": 1,\n\t\t\"linkadd\": true,\n\t\t\"vtable\": false,\n\t\t\"export_excel\": true,\n\t\t\"export_name\": \"list\",\n\t\t\"ngincludes\": {\n\t\t\t\"table\": \"\/static\/codenerix\/partials\/table.html\"\n\t\t},\n\t\t\"linkedit\": true,\n\t\t\"show_details\": true,\n\t\t\"show_modal\": false,\n\t\t\"search_filter_button\": false,\n\t\t\"request\": {\n\t\t\t\"path_info\": \"\/geodata\/continents\",\n\t\t\t\"query_string\": \"authtoken=test&amp;authuser=xxxxxxxx&amp;string=test&amp;force_rest_api=1\"\n\t\t},\n\t\t\"version\": \"0.1\",\n\t\t\"version_api\": null,\n\t\t\"gentranslate\": {\n\t\t\t\"Add\": \"A\\u00f1adir\",\n\t\t\t\"Cancel\": \"Cancelar\",\n\t\t\t\"Change\": \"Cambiar\",\n\t\t\t\"CleanFilters\": \"Limpiar filtros\",\n\t\t\t\"Date\": \"Fecha\",\n\t\t\t\"Day\": \"D\\u00eda\",\n\t\t\t\"Delete\": \"Borrar\",\n\t\t\t\"Done\": \"Hecho\",\n\t\t\t\"Download\": \"Descargar\",\n\t\t\t\"Edit\": \"Editar\",\n\t\t\t\"Error\": \"Error\",\n\t\t\t\"Filters\": \"Filtros\",\n\t\t\t\"Go_back\": \"Volver\",\n\t\t\t\"Hour\": \"Hora\",\n\t\t\t\"Month\": \"Mes\",\n\t\t\t\"Minute\": \"Minuto\",\n\t\t\t\"PageNumber\": \"N\\u00famero de p\\u00e1gina\",\n\t\t\t\"PleaseWait\": \"Por favor espere\",\n\t\t\t\"PrintExcel\": \"Imprimir en Excel\",\n\t\t\t\"Save\": \"Guardar\",\n\t\t\t\"Save_here\": \"Guardar aqu\\u00ed\",\n\t\t\t\"Save_and_new\": \"Guardar y nuevo\",\n\t\t\t\"Reload\": \"Recargar\",\n\t\t\t\"RowsPerPage\": \"Filas por p\\u00e1gina\",\n\t\t\t\"Search\": \"Buscar\",\n\t\t\t\"Second\": \"Segundo\",\n\t\t\t\"Time\": \"Hora\",\n\t\t\t\"View\": \"Ver\",\n\t\t\t\"Warning\": \"Atenci\\u00f3n\",\n\t\t\t\"Year\": \"A\\u00f1o\",\n\t\t\t\"registers\": \"registros\"\n\t\t},\n\t\t\"rowsperpage\": 50,\n\t\t\"rowsperpageallowed\": {\n\t\t\t\"All\": \"Todos\"\n\t\t},\n\t\t\"row_total\": 8,\n\t\t\"row_first\": 1,\n\t\t\"row_last\": 8,\n\t\t\"content_type\": null\n\t},\n\t\"filter\": {\n\t\t\"search\": \"\",\n\t\t\"date\": null,\n\t\t\"subfilters\": [],\n\t\t\"subfiltersC\": [{\n\t\t\t\"key\": \"code\",\n\t\t\t\"name\": \"C\\u00f3digo\",\n\t\t\t\"kind\": \"input\",\n\t\t\t\"value\": null\n\t\t}, {\n\t\t\t\"key\": \"es__name\",\n\t\t\t\"name\": \"Nombre\",\n\t\t\t\"kind\": \"input\",\n\t\t\t\"value\": null\n\t\t}]\n\t},\n\t\"table\": {\n\t\t\"head\": {\n\t\t\t\"columns\": [{\n\t\t\t\t\"id\": \"code\",\n\t\t\t\t\"name\": \"C\\u00f3digo\",\n\t\t\t\t\"align\": null,\n\t\t\t\t\"type\": \"CharField\"\n\t\t\t}, {\n\t\t\t\t\"id\": \"es__name\",\n\t\t\t\t\"name\": \"Nombre\",\n\t\t\t\t\"align\": null,\n\t\t\t\t\"type\": \"CharField\"\n\t\t\t}],\n\t\t\t\"ordering\": {},\n\t\t\t\"datetimeQ\": null,\n\t\t\t\"extra_fields\": {\n\t\t\t\t\"field_check\": null,\n\t\t\t\t\"field_delete\": false\n\t\t\t}\n\t\t},\n\t\t\"body\": [{\n\t\t\t\"pk\": \"1\",\n\t\t\t\"code\": \"Eu\",\n\t\t\t\"es__name\": \"Europa\"\n\t\t}, {\n\t\t\t\"pk\": \"2\",\n\t\t\t\"code\": \"As\",\n\t\t\t\"es__name\": \"Asia\"\n\t\t}, {\n\t\t\t\"pk\": \"3\",\n\t\t\t\"code\": \"Tc\",\n\t\t\t\"es__name\": \"Todos los continentes\"\n\t\t}, {\n\t\t\t\"pk\": \"5\",\n\t\t\t\"code\": \"AF\",\n\t\t\t\"es__name\": \"\\u00c1frica\"\n\t\t}, {\n\t\t\t\"pk\": \"6\",\n\t\t\t\"code\": \"AN\",\n\t\t\t\"es__name\": \"Ant\\u00e1rtida\"\n\t\t}, {\n\t\t\t\"pk\": \"7\",\n\t\t\t\"code\": \"OC\",\n\t\t\t\"es__name\": \"Ocean\\u00eda\"\n\t\t}, {\n\t\t\t\"pk\": \"8\",\n\t\t\t\"code\": \"NA\",\n\t\t\t\"es__name\": \"Norteam\\u00e9rica\"\n\t\t}, {\n\t\t\t\"pk\": \"9\",\n\t\t\t\"code\": \"SA\",\n\t\t\t\"es__name\": \"Sudam\\u00e9rica\"\n\t\t}],\n\t\t\"header\": null,\n\t\t\"summary\": null\n\t}\n}<\/pre>\n\n\n\n<p>But you may decide to filter the result, and then you would send a request including a &#8220;<strong>json<\/strong>&#8221; parameter in the URL:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"238\" src=\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/codenerix_list_filtered-1024x238.png\" alt=\"\" class=\"wp-image-744\" srcset=\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/codenerix_list_filtered-980x228.png 980w, https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/codenerix_list_filtered-480x112.png 480w\" sizes=\"auto, (min-width: 0px) and (max-width: 480px) 480px, (min-width: 481px) and (max-width: 980px) 980px, (min-width: 981px) 1024px, 100vw\" \/><figcaption class=\"wp-element-caption\">The &#8220;<strong>json<\/strong>&#8221; parameter in the URL will look like this: <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\"><strong> [ \/geodata\/continents?json=&#8230; ]<\/strong><\/mark><\/figcaption><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\t\"listid\": 0,\n\t\"search\": \"\",\n\t\"page\": 1,\n\t\"pages_to_bring\": 1,\n\t\"rowsperpage\": 50,\n\t\"filters\": {\n\t\t\"code\": null,\n\t\t\"en__name\": \"ame\"\n\t},\n\t\"ordering\": {\n\t\t\"en__name\": 1\n\t},\n\t\"year\": null,\n\t\"month\": null,\n\t\"day\": null,\n\t\"hour\": null,\n\t\"minute\": null,\n\t\"second\": null,\n\t\"context\": {},\n\t\"search_filter_button\": true\n}<\/pre>\n\n\n\n<p>And the answer would look like this:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\t\"meta\": {\n\t\t\"getval\": true,\n\t\t\"username\": \"xxxxxxxx\",\n\t\t\"context\": {},\n\t\t\"url_media\": \"\/media\/\",\n\t\t\"url_static\": \"\/static\/\",\n\t\t\"page\": 1,\n\t\t\"pages\": [1],\n\t\t\"pages_to_bring\": 1,\n\t\t\"linkadd\": true,\n\t\t\"vtable\": false,\n\t\t\"export_excel\": true,\n\t\t\"export_name\": \"list\",\n\t\t\"ngincludes\": {\n\t\t\t\"table\": \"\/static\/codenerix\/partials\/table.html\"\n\t\t},\n\t\t\"linkedit\": true,\n\t\t\"show_details\": true,\n\t\t\"show_modal\": false,\n\t\t\"search_filter_button\": true,\n\t\t\"request\": {\n\t\t\t\"path_info\": \"\/geodata\/continents\",\n\t\t\t\"query_string\": \"json=%7B%22listid%22:0,%22search%22:%22%22,%22page%22:1,%22pages_to_bring%22:1,%22rowsperpage%22:50,%22filters%22:%7B%22code%22:null,%22en__name%22:%22ame%22%7D,%22ordering%22:%7B%22en__name%22:1%7D,%22year%22:null,%22month%22:null,%22day%22:null,%22hour%22:null,%22minute%22:null,%22second%22:null,%22context%22:%7B%7D,%22search_filter_button%22:true%7D\"\n\t\t},\n\t\t\"gentranslate\": {\n\t\t\t\"Add\": \"A\\u00f1adir\",\n\t\t\t\"Cancel\": \"Cancelar\",\n\t\t\t\"Change\": \"Cambiar\",\n\t\t\t\"CleanFilters\": \"Limpiar filtros\",\n\t\t\t\"Date\": \"Fecha\",\n\t\t\t\"Day\": \"D\\u00eda\",\n\t\t\t\"Delete\": \"Borrar\",\n\t\t\t\"Done\": \"Hecho\",\n\t\t\t\"Download\": \"Descargar\",\n\t\t\t\"Edit\": \"Editar\",\n\t\t\t\"Error\": \"Error\",\n\t\t\t\"Filters\": \"Filtros\",\n\t\t\t\"Go_back\": \"Volver\",\n\t\t\t\"Hour\": \"Hora\",\n\t\t\t\"Month\": \"Mes\",\n\t\t\t\"Minute\": \"Minuto\",\n\t\t\t\"PageNumber\": \"N\\u00famero de p\\u00e1gina\",\n\t\t\t\"PleaseWait\": \"Por favor espere\",\n\t\t\t\"PrintExcel\": \"Imprimir en Excel\",\n\t\t\t\"Save\": \"Guardar\",\n\t\t\t\"Save_here\": \"Guardar aqu\\u00ed\",\n\t\t\t\"Save_and_new\": \"Guardar y nuevo\",\n\t\t\t\"Reload\": \"Recargar\",\n\t\t\t\"RowsPerPage\": \"Filas por p\\u00e1gina\",\n\t\t\t\"Search\": \"Buscar\",\n\t\t\t\"Second\": \"Segundo\",\n\t\t\t\"Time\": \"Hora\",\n\t\t\t\"View\": \"Ver\",\n\t\t\t\"Warning\": \"Atenci\\u00f3n\",\n\t\t\t\"Year\": \"A\\u00f1o\",\n\t\t\t\"registers\": \"registros\"\n\t\t},\n\t\t\"rowsperpage\": 50,\n\t\t\"rowsperpageallowed\": {\n\t\t\t\"All\": \"All\"\n\t\t},\n\t\t\"row_total\": 2,\n\t\t\"row_first\": 1,\n\t\t\"row_last\": 2,\n\t\t\"content_type\": null\n\t},\n\t\"filter\": {\n\t\t\"search\": \"\",\n\t\t\"date\": null,\n\t\t\"subfilters\": [],\n\t\t\"subfiltersC\": [{\n\t\t\t\"key\": \"code\",\n\t\t\t\"name\": \"Code\",\n\t\t\t\"kind\": \"input\",\n\t\t\t\"value\": null\n\t\t}, {\n\t\t\t\"key\": \"en__name\",\n\t\t\t\"name\": \"Name\",\n\t\t\t\"kind\": \"input\",\n\t\t\t\"value\": \"ame\"\n\t\t}]\n\t},\n\t\"table\": {\n\t\t\"head\": {\n\t\t\t\"columns\": [{\n\t\t\t\t\"id\": \"code\",\n\t\t\t\t\"name\": \"Code\",\n\t\t\t\t\"align\": null,\n\t\t\t\t\"type\": \"CharField\"\n\t\t\t}, {\n\t\t\t\t\"id\": \"en__name\",\n\t\t\t\t\"name\": \"Name\",\n\t\t\t\t\"align\": null,\n\t\t\t\t\"type\": \"CharField\"\n\t\t\t}],\n\t\t\t\"ordering\": {\n\t\t\t\t\"en__name\": 1\n\t\t\t},\n\t\t\t\"datetimeQ\": null,\n\t\t\t\"extra_fields\": {\n\t\t\t\t\"field_check\": null,\n\t\t\t\t\"field_delete\": false\n\t\t\t}\n\t\t},\n\t\t\"body\": [{\n\t\t\t\"pk\": \"8\",\n\t\t\t\"code\": \"NA\",\n\t\t\t\"en__name\": \"North America\"\n\t\t}, {\n\t\t\t\"pk\": \"9\",\n\t\t\t\"code\": \"SA\",\n\t\t\t\"en__name\": \"South America\"\n\t\t}],\n\t\t\"header\": null,\n\t\t\"summary\": null\n\t}\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">GenDetail &#8211; GET<\/h3>\n\n\n\n<p>A basic <strong>GET<\/strong> over a register with no parameters in the URL:  <strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">[ \/geodata\/continents\/5 ]<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\t\"meta\": {\n\t\t\"gentranslate\": {\n\t\t\t\"Add\": \"A\u00f1adir\",\n\t\t\t\"Cancel\": \"Cancelar\",\n\t\t\t\"Change\": \"Cambiar\",\n\t\t\t\"CleanFilters\": \"Limpiar filtros\",\n\t\t\t\"Date\": \"Fecha\",\n\t\t\t\"Day\": \"D\u00eda\",\n\t\t\t\"Delete\": \"Borrar\",\n\t\t\t\"Done\": \"Hecho\",\n\t\t\t\"Download\": \"Descargar\",\n\t\t\t\"Edit\": \"Editar\",\n\t\t\t\"Error\": \"Error\",\n\t\t\t\"Filters\": \"Filtros\",\n\t\t\t\"Go_back\": \"Volver\",\n\t\t\t\"Hour\": \"Hora\",\n\t\t\t\"Month\": \"Mes\",\n\t\t\t\"Minute\": \"Minuto\",\n\t\t\t\"PageNumber\": \"N\u00famero de p\u00e1gina\",\n\t\t\t\"PleaseWait\": \"Por favor espere\",\n\t\t\t\"PrintExcel\": \"Imprimir en Excel\",\n\t\t\t\"Save\": \"Guardar\",\n\t\t\t\"Save_here\": \"Guardar aqu\u00ed\",\n\t\t\t\"Save_and_new\": \"Guardar y nuevo\",\n\t\t\t\"Reload\": \"Recargar\",\n\t\t\t\"RowsPerPage\": \"Filas por p\u00e1gina\",\n\t\t\t\"Search\": \"Buscar\",\n\t\t\t\"Second\": \"Segundo\",\n\t\t\t\"Time\": \"Hora\",\n\t\t\t\"View\": \"Ver\",\n\t\t\t\"Warning\": \"Atenci\u00f3n\",\n\t\t\t\"Year\": \"A\u00f1o\",\n\t\t\t\"registers\": \"registros\"\n\t\t},\n\t\t\"linkedit\": true,\n\t\t\"linkdelete\": true,\n\t\t\"linkback\": true,\n\t\t\"cannot_delete\": null,\n\t\t\"cannot_update\": null,\n\t\t\"extra_context\": {\n\t\t\t\"no_render_as_foreign\": [],\n\t\t\t\"user\": \"xxxxxxxx\",\n\t\t\t\"ws_entry_point\": \"geodata\/continents\",\n\t\t\t\"static_partial_row\": \"\/static\/codenerix\/partials\/rows.html\",\n\t\t\t\"static_partial_header\": null,\n\t\t\t\"static_partial_summary\": \"\/static\/codenerix\/partials\/summary.html\",\n\t\t\t\"static_app_row\": \"\/static\/codenerix\/js\/app.js\",\n\t\t\t\"static_controllers_row\": null,\n\t\t\t\"static_filters_row\": \"\/static\/codenerix\/js\/rows.js\",\n\t\t\t\"field_delete\": false,\n\t\t\t\"field_check\": null,\n\t\t\t\"extends_base\": \"base\/base.html\",\n\t\t\t\"tabs_js\": \"[]\",\n\t\t\t\"is_modal_window\": false,\n\t\t\t\"tabs_autorender\": []\n\t\t}\n\t},\n\t\"body\": {\n\t\t\"code\": \"AF\",\n\t\t\"es__name\": \"\u00c1frica\"\n\t}\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">GenAdd &#8211; GET<\/h3>\n\n\n\n<p>A basic <strong>GET<\/strong> to add a new element with authjson_details enabled: <br><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">[ \/geodata\/continents\/add?authtoken=&#8230;&amp;authuser=&#8230;.&amp;json={}&amp;force_rest_api=1&amp;authjson_details=1 ]<\/mark><\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"json\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">{\n\t\"head\": {\n\t\t\"bound\": false,\n\t\t\"groups\": [\n\t\t\t[\n\t\t\t\t\"Details\",\n\t\t\t\t12,\n\t\t\t\t[\n\t\t\t\t\t\"code\",\n\t\t\t\t\t6\n\t\t\t\t]\n\t\t\t]\n\t\t],\n\t\t\"form_name\": \"AF8Q903HFSO8RZB\"\n\t},\n\t\"meta\": {\n\t\t\"version\": \"0.1\",\n\t\t\"version_api\": null\n\t},\n\t\"body\": {\n\t\t\"code\": {\n\t\t\t\"for\": \"id_GeoContinentForm_code\",\n\t\t\t\"type\": \"char\",\n\t\t\t\"html_name\": \"GeoContinentForm_code\",\n\t\t\t\"value\": \"\",\n\t\t\t\"label\": \"Code\",\n\t\t\t\"notes\": [\n\t\t\t\t\"This field is required.\",\n\t\t\t\t\"Ensure this value has at most 2 characters\"\n\t\t\t],\n\t\t\t\"limits\": {\n\t\t\t\t\"max_length\": 2,\n\t\t\t\t\"required\": true\n\t\t\t}\n\t\t},\n\t\t\"name\": {\n\t\t\t\"for\": \"id_ContinentTextFormEN_name\",\n\t\t\t\"type\": \"char\",\n\t\t\t\"html_name\": \"ContinentTextFormEN_name\",\n\t\t\t\"value\": \"\",\n\t\t\t\"label\": \"Name\",\n\t\t\t\"notes\": [\n\t\t\t\t\"This field is required.\",\n\t\t\t\t\"Ensure this value has at most 100 characters\"\n\t\t\t],\n\t\t\t\"limits\": {\n\t\t\t\t\"max_length\": 100,\n\t\t\t\t\"required\": true\n\t\t\t}\n\t\t}\n\t}\n}<\/pre>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Final<\/h2>\n\n\n\n<p>For any questions you may have about the RESTful API, check your browser for extra information and check out how <strong><span style=\"color: #343433;\"><strong><a href=\"https:\/\/github.com\/codenerix\/django-codenerix\"><span style=\"color: #343433;\">CODE<\/span><span style=\"color: #70a8e0;\">NERIX<\/span><\/a><\/strong><\/span><\/strong> is doing under the hood.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will learn how does work CODENERIX API. Since all the operations between the front and back end are happening through JSON communication, it is easy to think there is a protocol behind all of that. In fact, there is a RESTful API based on JSON to manage everything that is happening [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":792,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-766","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howto"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>CODENERIX API - Codenerix<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codenerix.com\/en\/codenerix-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CODENERIX API - Codenerix\" \/>\n<meta property=\"og:description\" content=\"In this article, you will learn how does work CODENERIX API. Since all the operations between the front and back end are happening through JSON communication, it is easy to think there is a protocol behind all of that. In fact, there is a RESTful API based on JSON to manage everything that is happening [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codenerix.com\/en\/codenerix-api\/\" \/>\n<meta property=\"og:site_name\" content=\"Codenerix\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-18T17:43:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-04-06T06:26:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2176\" \/>\n\t<meta property=\"og:image:height\" content=\"1224\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Codenerix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Codenerix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/\"},\"author\":{\"name\":\"Codenerix\",\"@id\":\"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af\"},\"headline\":\"CODENERIX API\",\"datePublished\":\"2022-06-18T17:43:03+00:00\",\"dateModified\":\"2023-04-06T06:26:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/\"},\"wordCount\":506,\"image\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg\",\"articleSection\":[\"Howto\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/\",\"url\":\"https:\/\/codenerix.com\/en\/codenerix-api\/\",\"name\":\"CODENERIX API - Codenerix\",\"isPartOf\":{\"@id\":\"https:\/\/codenerix.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg\",\"datePublished\":\"2022-06-18T17:43:03+00:00\",\"dateModified\":\"2023-04-06T06:26:24+00:00\",\"author\":{\"@id\":\"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af\"},\"breadcrumb\":{\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codenerix.com\/en\/codenerix-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage\",\"url\":\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg\",\"contentUrl\":\"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg\",\"width\":2176,\"height\":1224},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codenerix.com\/en\/codenerix-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codenerix.com\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CODENERIX API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codenerix.com\/#website\",\"url\":\"https:\/\/codenerix.com\/\",\"name\":\"Codenerix\",\"description\":\"Framework libre Open Source\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codenerix.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af\",\"name\":\"Codenerix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codenerix.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dee2772994eb5d89e57afac281bca674800da15c6c32fba528dea162570d644d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dee2772994eb5d89e57afac281bca674800da15c6c32fba528dea162570d644d?s=96&d=mm&r=g\",\"caption\":\"Codenerix\"},\"url\":\"https:\/\/codenerix.com\/en\/author\/codenerix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CODENERIX API - Codenerix","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/codenerix.com\/en\/codenerix-api\/","og_locale":"en_US","og_type":"article","og_title":"CODENERIX API - Codenerix","og_description":"In this article, you will learn how does work CODENERIX API. Since all the operations between the front and back end are happening through JSON communication, it is easy to think there is a protocol behind all of that. In fact, there is a RESTful API based on JSON to manage everything that is happening [&hellip;]","og_url":"https:\/\/codenerix.com\/en\/codenerix-api\/","og_site_name":"Codenerix","article_published_time":"2022-06-18T17:43:03+00:00","article_modified_time":"2023-04-06T06:26:24+00:00","og_image":[{"width":2176,"height":1224,"url":"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg","type":"image\/jpeg"}],"author":"Codenerix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Codenerix","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#article","isPartOf":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/"},"author":{"name":"Codenerix","@id":"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af"},"headline":"CODENERIX API","datePublished":"2022-06-18T17:43:03+00:00","dateModified":"2023-04-06T06:26:24+00:00","mainEntityOfPage":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/"},"wordCount":506,"image":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage"},"thumbnailUrl":"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg","articleSection":["Howto"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/codenerix.com\/en\/codenerix-api\/","url":"https:\/\/codenerix.com\/en\/codenerix-api\/","name":"CODENERIX API - Codenerix","isPartOf":{"@id":"https:\/\/codenerix.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage"},"image":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage"},"thumbnailUrl":"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg","datePublished":"2022-06-18T17:43:03+00:00","dateModified":"2023-04-06T06:26:24+00:00","author":{"@id":"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af"},"breadcrumb":{"@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codenerix.com\/en\/codenerix-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#primaryimage","url":"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg","contentUrl":"https:\/\/codenerix.com\/wp-content\/uploads\/2022\/06\/api.jpg","width":2176,"height":1224},{"@type":"BreadcrumbList","@id":"https:\/\/codenerix.com\/en\/codenerix-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codenerix.com\/en\/"},{"@type":"ListItem","position":2,"name":"CODENERIX API"}]},{"@type":"WebSite","@id":"https:\/\/codenerix.com\/#website","url":"https:\/\/codenerix.com\/","name":"Codenerix","description":"Framework libre Open Source","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codenerix.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/codenerix.com\/#\/schema\/person\/c1dce0f30541a2be119ee8adc332a9af","name":"Codenerix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codenerix.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dee2772994eb5d89e57afac281bca674800da15c6c32fba528dea162570d644d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dee2772994eb5d89e57afac281bca674800da15c6c32fba528dea162570d644d?s=96&d=mm&r=g","caption":"Codenerix"},"url":"https:\/\/codenerix.com\/en\/author\/codenerix\/"}]}},"_links":{"self":[{"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/posts\/766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/comments?post=766"}],"version-history":[{"count":4,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/posts\/766\/revisions"}],"predecessor-version":[{"id":858,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/posts\/766\/revisions\/858"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/media\/792"}],"wp:attachment":[{"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/media?parent=766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/categories?post=766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codenerix.com\/en\/wp-json\/wp\/v2\/tags?post=766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}