{"componentChunkName":"component---src-templates-default-template-tsx","path":"/documentation/integration/CSV/connector/","result":{"data":{"asciidoc":{"id":"b318049d-c290-5934-bddf-ec76f3567b40","html":"<div class=\"sect1\">\n<h2 id=\"_about_the_csv_connector\">About the csv connector</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The csv connector ships with every HIRO instance and enables you to create Automation issues and upload environment and monitoring data.\nIt makes use of HIROs Rest API using CSV files as input. We&#8217;ve put together sample csv files for each scenario to help you get started.</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_first_things_first_get_your_token\">First things first: get your token!</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>A token is mandatory to use any of the capabilities the csv connector offers. To retrieve a token, you must run a Post request against <a href=\"https://core.engine.datagroup.de/api/auth/6/app\" class=\"bare\">https://core.engine.datagroup.de/api/auth/6/app</a>.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-json\" data-lang=\"json\">{\n    \"client_secret\": \"ffc55c735c79d22441e941b09fbe9afbda839dc12012b7bd37f9d88b54fd13add74fdef8abf8194e9729a281bfbe68935950fef7a9dd690827082fc611f68492\",\n    \"client_id\": \"cju16o7cf0000mz77pbwbhl3q_ckkwosk448atc01543wvzxvb4\",\n    \"username\":\"\",\n    \"password\": \"\"\n}</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>Username and password is created for every HIRO 7 instance that is provisioned for you. The login information is generated and can be found on id.almato.ai. The organisation admin will be able to change the pregenerated password for the user that is called haas<strong>*</strong>-csv-connector.\nThe scope id, an id that identifies which HIRO 7 instance the csv content can be found doing a GET request with the token from the username above against <a href=\"https://core.engine.datagroup.de/api/auth/6/me/account?profile=true\" class=\"bare\">https://core.engine.datagroup.de/api/auth/6/me/account?profile=true</a>\nThe scope can be found in \"ogit/Auth/Account/defaultScope\"</p>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_how_to_use_the_csv_connector\">How to use the CSV Connector</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The CSV Connector works with HTTP requests. All capabilities share the same base url (<a href=\"https://api.hiro.almato.ai/function/csv-connector\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector</a>) followed by the action after the slash, such as /vertices /edges /timeseries or /attachments. You can either run those request from command line or any tool of your choice (such as postman for instance)</p>\n</div>\n<div class=\"paragraph\">\n<p>Please make sure to add the following header information to your requests</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>x-forwarded-authorization: Bearer ${your_token}\ncontent-type: text/csv</pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>Additional header parameters control details of csv handling within the connector:</p>\n</div>\n<table class=\"tableblock frame-all grid-all stretch\">\n<colgroup>\n<col style=\"width: 50%;\">\n<col style=\"width: 50%;\">\n</colgroup>\n<thead>\n<tr>\n<th class=\"tableblock halign-left valign-top\">Header</th>\n<th class=\"tableblock halign-left valign-top\">Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\"><code>x-connector-csv-dialect</code></p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Set the csv dialect for the csv parser (<code>default</code>, <code>unix</code>, <code>excel</code>, <code>excel-tab</code> or <code>excel-semicolon</code>). Default is <code>default</code>, which is a version of <code>unix</code> with additional settings:<br>\n<code><em>quoting=csv.QUOTE_ALL, skipinitialspace=True, strict=True</em></code>.<br>\nThe parser used internally is from Pythons' csv package.</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\"><code>x-connector-csv-json-strings</code></p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Boolean value. When set to <code>true</code>, turns on the interpretation of the CSV data cells as JSON strings. Default is <code>false</code>.</p></td>\n</tr>\n<tr>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\"><code>x-connector-csv-null-keyword</code></p></td>\n<td class=\"tableblock halign-left valign-top\"><p class=\"tableblock\">Take the string given here as null keyword to set attributes for HIRO explicitly to None.<br>\nDefault keyword is <code>null</code>.</p></td>\n</tr>\n</tbody>\n</table>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_1_how_to_create_ontology_objects_verticesnodes\">1. How to create ontology objects (vertices/nodes)</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the token in hand you can run a POST request against.</p>\n</div>\n<div class=\"paragraph\">\n<p><a href=\"https://api.hiro.almato.ai/function/csv-connector/vertices\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/vertices</a></p>\n</div>\n<div class=\"paragraph\">\n<p>using the following sample CSV file. Please make sure to add a value for scope. If you want to create more than one object, you can add more lines to the csv file.\nKeep in mind POST does not allow you to update existing objects. Please use a PUT request if you want to update.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/MARS/Machine/class\",\"ogit/name\",\"ogit/MARS/Software/class\",\"ogit/MARS/Software/subClass\",\"ogit/_scope\"\n\"machine1\",\"ogit/MARS/Machine\",\"Linux\",\"machine a\",\"\",\"\",\"cjuwixjvq0xfc1q90xqn8jsvf_ckcd798hd7bji0r882l764ebl\"\n\"software1\",\"ogit/MARS/Software\",\"\", \"Software A\",\"DBMS\",\"MariaDB\",\"cjuwixjvq0xfc1q90xqn8jsvf_ckcd798hd7bji0r882l764ebl\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_2_how_to_inject_an_automation_issue\">2. How to inject an automation issue</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the token in hand you can run a POST request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/vertices\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/vertices</a></p>\n</div>\n<div class=\"paragraph\">\n<p>using the following sample CSV file. Please make sure to add a value for scope and origin node. The origin node defines where the issue is bound to first, where knowledge can be applied (if available). If you do not have an origin Node, please check part 1 where we show you how to create one.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/subject\",\"ogit/Automation/originNode\",\"/ProcessIssue\",\"ogit/_type\",\"ogit/_scope\"\n\"This is a test Issue\",\"node_id\",\"process_me\",\"ogit/Automation/AutomationIssue\",\"scope_id\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_3_how_to_create_an_issue_and_a_node_combined\">3. How to create an issue and a node combined</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the token in hand you can run a PUT request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/combined\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/combined</a></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/MARS/Machine/class\",\"ogit/name\",\"ogit/MARS/Software/classv,\"ogit/MARS/Software/subClass\",\"ogit/_scope\",\"issue:0:ogit/subject\",\"\"issue:0:/ProcessIssue\"\n\"machine1234\",\"ogit/MARS/Machine\",\"Linux\",\"machine a\",\"\",\"\",\"cjy5tvdfx0nkq1o7040e4mow0_ckd73u0ul04jo01100j5dppq7\",\"\",\"\"\n\"software1123\",\"ogit/MARS/Software\",\"\",\"Software A\",\"DBMS\",\"MariaDB\",\"cjy5tvdfx0nkq1o7040e4mow0_ckd73u0ul04jo01100j5dppq7\",\"test issue\",\"processme\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_4_how_to_create_an_edge_connect_a_node\">4. How to create an edge (connect a Node)</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the token in hand you can run a POST request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/edges\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/edges</a></p>\n</div>\n<div class=\"paragraph\">\n<p>using the following sample CSV file.</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"from:ogit/_xid\",\"verb\",\"to:ogit/_xid\"\n\"software1\",\"ogit/dependsOn\",\"machine1\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_5_how_to_create_an_edge_and_node_combined\">5. How to create an edge and node combined</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the token in hand you can run a PUT request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/combined\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/combined</a></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/MARS/Machine/class\",\"ogit/name\",\"ogit/MARS/Software/class\",\"ogit/MARS/Software/subClass\",\"ogit/_scope\",\"edge:0:verb\",\"edge:0:direction\",\"edge:0:vertex_xid\"\n\"machine1\",\"ogit/MARS/Machine\",\"Linux\",\"machine a\",\"\",\"\",\"cjuwixjvq0xfc1q90xqn8jsvf_ckcd798hd7bji0r882l764ebl\",\"\",\"\",\"\"\n\"software1\",\"ogit/MARS/Software\",\"\",\"Software A\",\"DBMS\",\"MariaDB\",\"cjuwixjvq0xfc1q90xqn8jsvf_ckcd798hd7bji0r882l764ebl\",\"ogit/dependsOn\",\"out\",\"machine1\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_6_how_to_create_a_timeseries_object\">6. How to create a timeseries object</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>First create a timeseries node\nWith the token in hand you can run a POST request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/vertices\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/vertices</a></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/name\",\"ogit/_scope\"\n\"timeseries\",\"ogit/Timeseries\",\"tsname\",\"scopeid\"</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>Then</p>\n</div>\n<div class=\"paragraph\">\n<p>With the token in hand you can run a PUT request against\n<a href=\"https://api.hiro.almato.ai/function/csv-connector/timeseries\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/timeseries</a></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"timestamp\",\"value\"\n\"timeseries\",\"1442235678000\",\"45\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_error_handling\">Error Handling</h2>\n<div class=\"sectionbody\">\n<div class=\"ulist\">\n<ul>\n<li>\n<p>Feedback is provided if the csv file was processed successfully and how many objects of each type were populated.</p>\n</li>\n<li>\n<p>A hard stop occurs incase the reading of a csv file encounters a malformed entry and the error is not recoverable. All items before the error will be processed.</p>\n</li>\n<li>\n<p>If the error is recoverable, an error message with status \"fail\" will be put onto the result data and the operation will continue.</p>\n</li>\n</ul>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_format_of_csv_data\">Format of CSV data</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Specifications of the format of csv data so the CSV connector can parse the data correctly. Parsing is based of\nPythons' csv package.</p>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>General format</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>The encoding is UTF-8.</p>\n</div>\n<div class=\"paragraph\">\n<p>The separator is a comma <code>,</code>.</p>\n</div>\n<div class=\"paragraph\">\n<p>Each row must have the same number of values.\nRows must be filled with empty values if necessary.</p>\n</div>\n<div class=\"paragraph\">\n<p>Each value in the CSV must be enclosed in double-quotes <code>&quot;</code>.\nQuotes are escaped via doubling, i.e.  <code>&quot;I am &quot;&quot;quoted&quot;&quot;.&quot;</code>.</p>\n</div>\n<div class=\"paragraph\">\n<p>The CSV has to have a header row.\nFor vertices these are the ogit attribute names.</p>\n</div>\n<div class=\"paragraph\">\n<p>The CSV will be transformed using Pythons' csv package with a special dialect called <code>default</code> (unless configured otherwise in header parameter <code>x-connector-csv-dialect</code>).\nThe settings for this dialect are:\n<code><em>quoting=csv.QUOTE_ALL, skipinitialspace=True, strict=True</em></code></p>\n</div>\n<div class=\"paragraph\">\n<p>Each row below the header specifies a set of values for one entity (vertex, edge, timeseries or attachment).</p>\n</div>\n<div class=\"paragraph\">\n<p>The strings parsed from each cell can be interpreted as JSON when header parameter <code>x-connector-csv-json-strings</code> is enabled.\nThe values of the CSV will then be enclosed in quotes and run through json.loads(escaped_value).\nIf this is set to true, special characters like <code>\\</code>, <code>&quot;</code>, line-breaks or tabulator characters need to be properly escaped for JSON and remember that you still have to quote the <code>&quot;</code> for CSV as well.</p>\n</div>\n<div class=\"paragraph\">\n<p><em>Examples of a CSV cell</em></p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><em>without JSON Strings:</em></p>\n</li>\n</ul>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>\"Hello \"\"friend\"\",\nhow are you? Look at C:\\Users\\Foo\\\"</pre>\n</div>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><em>with JSON Strings:</em></p>\n</li>\n</ul>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre>\"Hello \\\"\"friend\\\"\",\\nhow are you? Look at C:\\\\Users\\\\Foo\\\\\"</pre>\n</div>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>Format of the CSV data for vertices</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Relevant REST endpoints:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-http request\" data-lang=\"http request\">POST https://api.hiro.almato.ai/function/csv-connector/vertices\nPATCH https://api.hiro.almato.ai/function/csv-connector/vertices\nPUT https://api.hiro.almato.ai/function/csv-connector/vertices\nDELETE https://api.hiro.almato.ai/function/csv-connector/vertices</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The header row contains ogit attribute names.</p>\n</div>\n<div class=\"paragraph\">\n<p>An empty value <code>&quot;&quot;</code> in a row tells the connector to ignore the attribute specified by that column for this row instead of setting it to an empty value.</p>\n</div>\n<div class=\"paragraph\">\n<p>A string value of <code>&quot;null&quot;</code> (or whatever is currently configured in header parameter <code>x-connector-csv-null-keyword</code>) in a row will make the connector set the attribute specified by that column explicitly to JSON null.\nThis is needed to remove attributes of a vertex on an update.</p>\n</div>\n<div class=\"paragraph\">\n<p>Headers that start with <code>xid:</code> and contain ogit/_xid values are resolved to ogit/_id by querying HIRO.</p>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em><br>\n<code>xid:ogit/Automation/originNode</code> would treat all values below as ogit/_xid and resolve them to ogit/_id before using them as attribute <code>ogit/Automation/originNode</code> in the vertices to create or update.</p>\n</div>\n<div class=\"paragraph\">\n<p>Headers that start with <code>=</code>, <code>+</code> or <code>-</code> denote map value entries (see HIRO attribute specification).\nValues within these columns are directly interpreted as JSON.</p>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/MARS/Machine/class\",\"ogit/name\",\"ogit/MARS/Machine/ram\",\"/admin_contact\"\n\"machine4\",\"ogit/MARS/Machine\",\"Linux\",\"machine 4\",\"2G\",\"info@admin.co\"\n\"machine5\",\"ogit/MARS/Machine\",\"Linux\",\"machine 5\",\"4G\",\"contact@admin.co\"\n\"machine6\",\"ogit/MARS/Machine\",\"Linux\",\"machine 5A\",\"8G\",\"info@admin.co\"\n\"machine7\",\"ogit/MARS/Machine\",\"Linux\",\"machine 4A\",\"4G\",\"contact@admin.co\"</code></pre>\n</div>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>Format of the CSV data for edges</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Relevant REST endpoints:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-http request\" data-lang=\"http request\">POST https://api.hiro.almato.ai/function/csv-connector/edges\nDELETE https://api.hiro.almato.ai/function/csv-connector/edges</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The CSV has to have three headers:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>from:ogit/_id</code> or <code>from:ogit/_xid</code></p>\n</li>\n<li>\n<p><code>verb</code> The ogit verb for the edge</p>\n</li>\n<li>\n<p><code>to:ogit/_id</code> or <code>to:ogit/_xid</code></p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"from:ogit/_xid\",\"verb\",\"to:ogit/_xid\"\n\"crew:NCC-1701-D:picard\",\"ogit/Forum/mentions\",\"crew:NCC-1701-D:data\"</code></pre>\n</div>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>Format of the CSV data for timeseries</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Relevant REST endpoints:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-http request\" data-lang=\"http request\">PUT https://api.hiro.almato.ai/function/csv-connector/timeseries</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The CSV has to have three headers:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>ogit/_id</code> or <code>ogit/_xid</code></p>\n</li>\n<li>\n<p><code>timestamp</code> for ms since epoch or <code>time</code> for an ISO time</p>\n</li>\n<li>\n<p><code>value</code> for the value for this timestamp.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"timestamp\",\"value\"\n\"timeseries:machine4\",\"1442235678000\",\"45\"\n\"timeseries:machine4\",\"1442235944000\",\"43\"\n\"timeseries:machine5\",\"1442235678000\",\"51\"\n\"timeseries:machine5\",\"1442235944000\",\"48\"</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>or two headers:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>ogit/_id</code> or <code>ogit/_xid</code></p>\n</li>\n<li>\n<p><code>items</code> for a JSON list of objects containing the keys (<code>timestamp</code> or <code>time</code>) and <code>value</code>.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"items\"\n\"timeseries:machine4\",\"[{\"\"timestamp\"\": \"\"1442235678000\"\", \"\"value\"\":\"\"45\"\"},{\"\"timestamp\"\": \"\"1442235944000\"\", \"\"value\"\":\"\"51\"\"}]\"\n\"timeseries:machine5\",\"[{\"\"timestamp\"\": \"\"1442235678000\"\", \"\"value\"\":\"\"43\"\"},{\"\"timestamp\"\": \"\"1442235944000\"\", \"\"value\"\":\"\"48\"\"}]\"</code></pre>\n</div>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>Format of the CSV data for attachments</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Relevant REST endpoints:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-http request\" data-lang=\"http request\">PUT https://api.hiro.almato.ai/function/csv-connector/attachments</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The CSV needs the following headers:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>ogit/_id</code> or <code>ogit/_xid</code></p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>One of the following headers is required for the content of the attachment:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>content:text</code>: Content to upload as simple text in UTF-8.</p>\n</li>\n<li>\n<p><code>content:base64</code>: Content to upload as base64 encoded binary data.</p>\n</li>\n<li>\n<p><code>content:mimetype</code>: (optional) Content-Type of the content.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"content:mimetype\",\"content:text\",\"content:base64\"\n\"attachment:arago:test:0:lorem-ipsum\",\"text/plain\",\"Auch gibt es niemanden, der den Schmerz an sich liebt, sucht oder wünscht, nur, weil er Schmerz ist, es sei denn, es kommt zu zufälligen Umständen, in denen Mühen und Schmerz ihm große Freude bereiten können.\n\nUm ein triviales Beispiel zu nehmen, wer von uns unterzieht sich je anstrengender körperlicher Betätigung, außer um Vorteile daraus zu ziehen? Aber wer hat irgend ein Recht, einen Menschen zu tadeln, der die Entscheidung trifft, eine Freude zu genießen, die keine unangenehmen Folgen hat, oder einen, der Schmerz vermeidet, welcher keine daraus resultierende Freude nach sich zieht? Auch gibt es niemanden, der den Schmerz \",\"\"\n\"attachment:arago:test:1:lorem-ipsum\",\"text/plain\",\"\",\"QXVjaCBnaWJ0IGVzIG5pZW1hbmRlbiwgZGVyIGRlbiBTY2htZXJ6IGFuIHNpY2ggbGllYnQsIHN1\nY2h0IG9kZXIgd8O8bnNjaHQsIG51ciwgd2VpbCBlciBTY2htZXJ6IGlzdCwgZXMgc2VpIGRlbm4s\nIGVzIGtvbW10IHp1IHp1ZsOkbGxpZ2VuIFVtc3TDpG5kZW4sIGluIGRlbmVuIE3DvGhlbiB1bmQg\nU2NobWVyeiBpaG0gZ3Jvw59lIEZyZXVkZSBiZXJlaXRlbiBrw7ZubmVuLgoKVW0gZWluIHRyaXZp\nYWxlcyBCZWlzcGllbCB6dSBuZWhtZW4sIHdlciB2b24gdW5zIHVudGVyemllaHQgc2ljaCBqZSBh\nbnN0cmVuZ2VuZGVyIGvDtnJwZXJsaWNoZXIgQmV0w6R0aWd1bmcsIGF1w59lciB1bSBWb3J0ZWls\nZSBkYXJhdXMgenUgemllaGVuPyBBYmVyIHdlciBoYXQgaXJnZW5kIGVpbiBSZWNodCwgZWluZW4g\nTWVuc2NoZW4genUgdGFkZWxuLCBkZXIgZGllIEVudHNjaGVpZHVuZyB0cmlmZnQsIGVpbmUgRnJl\ndWRlIHp1IGdlbmllw59lbiwgZGllIGtlaW5lIHVuYW5nZW5laG1lbiBGb2xnZW4gaGF0LCBvZGVy\nIGVpbmVuLCBkZXIgU2NobWVyeiB2ZXJtZWlkZXQsIHdlbGNoZXIga2VpbmUgZGFyYXVzIHJlc3Vs\ndGllcmVuZGUgRnJldWRlIG5hY2ggc2ljaCB6aWVodD8gQXVjaCBnaWJ0IGVzIG5pZW1hbmRlbiwg\nZGVyIGRlbiBTY2htZXJ6IAo=\"</code></pre>\n</div>\n</div>\n<hr>\n<div class=\"paragraph\">\n<p><strong>Simultaneous handling of vertices, issues, edges and/or attachments</strong></p>\n</div>\n<div class=\"paragraph\">\n<p>Relevant REST endpoints:</p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-http request\" data-lang=\"http request\">PUT https://api.hiro.almato.ai/function/csv-connector/combined</code></pre>\n</div>\n</div>\n<div class=\"paragraph\">\n<p>The format of the CSV data for vertices applies here, see above.</p>\n</div>\n<div class=\"paragraph\">\n<p><em>Edges</em></p>\n</div>\n<div class=\"paragraph\">\n<p>The format of an edge header is <code>edge:[id]:[attribute]</code>. <code>[id]</code> is an identifier to group edge commands together (most simple case: a number).\nThis <code>[id]</code> must not contain a <code>:</code> since this is used as separator.</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>edge:[id]:verb</code>: (required) Verb for that edge for the vertex of the current row.</p>\n</li>\n<li>\n<p><code>edge:[id]:direction</code>: (\"in\"/\"out\") from the view of the current vertex of that row. \"in\" points towards, \"out\" points away from the current vertex.\nDefault is \"out\" if this column is missing.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p>One of the following headers is required to find the vertex to connect to:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>edge:[id]:vertex_id</code>: ogit/_id of the other vertex to connect to.</p>\n</li>\n<li>\n<p><code>edge:[id]:vertex_xid</code>: ogit/_xid of the other vertex to connect to.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Attachments</em></p>\n</div>\n<div class=\"paragraph\">\n<p>The format of an attachment header is <code>content:[attribute]</code>:</p>\n</div>\n<div class=\"paragraph\">\n<p>One of the following headers is required for the content of the attachment:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p><code>content:text</code>: Content to upload as simple text in UTF-8.</p>\n</li>\n<li>\n<p><code>content:base64</code>: Content to upload as base64 encoded binary data.</p>\n</li>\n<li>\n<p><code>content:mimetype</code>: (optional) Content-Type of the content.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Issues</em></p>\n</div>\n<div class=\"paragraph\">\n<p>The format of an issue header is <code>issue:[id]:[attribute]</code>. <code>[id]</code> is an identifier to group issue commands together for multiple issues to be created. Some attributes of each issue will be set automatically:</p>\n</div>\n<div class=\"ulist\">\n<ul>\n<li>\n<p>ogit/_type: Will be set to ogit/Automation/AutomationIssue</p>\n</li>\n<li>\n<p>ogit/Automation/originNode: Will be set to the ogit/_id of the vertex that has been created on the same row.</p>\n</li>\n</ul>\n</div>\n<div class=\"paragraph\">\n<p><em>Example:</em></p>\n</div>\n<div class=\"listingblock\">\n<div class=\"content\">\n<pre class=\"highlight\"><code class=\"language-csv\" data-lang=\"csv\">\"ogit/_xid\",\"ogit/_type\",\"ogit/name\",\"ogit/Forum/username\",\"edge:0:verb\",\"edge:0:direction\",\"edge:0:vertex_xid\",\"edge:1:verb\",\"edge:1:direction\",\"edge:1:vertex_xid\"\n\"crew:NCC-1701-D:picard\",\"ogit/Forum/Profile\",\"Jean-Luc Picard\",\"Picard\",\"ogit/Forum/mentions\",\"out\",\"crew:NCC-1701-D:data\",\"ogit/Forum/mentions\",\"out\",\"crew:NCC-1701-D:worf\"\n\"crew:NCC-1701-D:worf\",\"ogit/Forum/Profile\",\"Worf\",\"Worf\",\"ogit/subscribes\",\"out\",\"crew:NCC-1701-D:picard\",\"\",\"\",\"\"\n\"crew:NCC-1701-D:data\",\"ogit/Forum/Profile\",\"Data\",\"Data\",\"ogit/Forum/mentions\",\"out\",\"crew:NCC-1701-D:worf\",\"ogit/subscribes\",\"in\",\"crew:NCC-1701-D:worf\"</code></pre>\n</div>\n</div>\n</div>\n</div>\n<div class=\"sect1\">\n<h2 id=\"_additional_documentation\">Additional Documentation</h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>A complete API documentation is available under <a href=\"https://api.hiro.almato.ai/function/csv-connector/docs\" class=\"bare\">https://api.hiro.almato.ai/function/csv-connector/docs</a></p>\n</div>\n</div>\n</div>","document":{"main":"About the csv connector","title":"About the csv connector","subtitle":""},"fields":{"toc":false,"location":["documentation","integration","CSV","connector"]}},"sidebarYaml":{"id":"6d066bdd-c982-5a69-b909-a31e6fc044e0","showIndex":null}},"pageContext":{"id":"b318049d-c290-5934-bddf-ec76f3567b40","parent":"documentation"}},"staticQueryHashes":["1010459453","1010459453","2356112386","2356112386","2603905930","2603905930","3026652197","3026652197","3167850324","3167850324","63159454","63159454"]}