curl --request POST \
--url https://api.eddy.engineer/v1/earthing.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"frame": {},
"blob": "<string>",
"depth_m": 123,
"include_document": true,
"into_key": "<string>",
"method": "<string>",
"name": "<string>",
"node_crossings": true,
"radius_m": 123,
"rod_length_m": 123,
"rod_radius_m": 123,
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/earthing.import"
payload = {
"frame": {},
"blob": "<string>",
"depth_m": 123,
"include_document": True,
"into_key": "<string>",
"method": "<string>",
"name": "<string>",
"node_crossings": True,
"radius_m": 123,
"rod_length_m": 123,
"rod_radius_m": 123,
"text": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
frame: {},
blob: '<string>',
depth_m: 123,
include_document: true,
into_key: '<string>',
method: '<string>',
name: '<string>',
node_crossings: true,
radius_m: 123,
rod_length_m: 123,
rod_radius_m: 123,
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/earthing.import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/earthing.import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'frame' => [
],
'blob' => '<string>',
'depth_m' => 123,
'include_document' => true,
'into_key' => '<string>',
'method' => '<string>',
'name' => '<string>',
'node_crossings' => true,
'radius_m' => 123,
'rod_length_m' => 123,
'rod_radius_m' => 123,
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/earthing.import"
payload := strings.NewReader("{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/earthing.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/earthing.import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Import soil traverses from CSV as a survey, or a conductor layout from GeoJSON as a system
format: csv: a field sheet with a header row and one reading per row (traverse, method wenner | schlumberger | dipole_dipole, a_m, ab2_m, mn2_m, n, resistance_ohm, apparent_resistivity_ohm_m, x_m, y_m, bearing_deg, date, instrument, note, excluded; SI units, not converted), as ss.earthing.survey/1. format: geojson: a layout whose features become elements by geometry and kind property (lines are conductors, points rods, polygons fences, surface layers or closed conductors, role makes an object at risk), as ss.earthing.system/1; crossings are noded by default, and into_key adds the layout to a stored system by its add edits. What the importer does not carry is an import finding (import_findings), never dropped silently; a default the caller gave is counted. Refused by name: EARTHING_REQUEST (400: the body, an unknown member, a layout member on a CSV import), EARTHING_SETTINGS (400: frame, coordinates or z that does not read), EARTHING_IMPORT_INVALID (400: a file that cannot be read at all: no header, no readings column, not UTF-8, not GeoJSON), EARTHING_DOCUMENT_NOT_FOUND (404: into_key). TL3c: blob (a blob id) instead of text: the file is read from the blob as the caller and imported exactly as if sent inline; giving both is 400 FILE_GIVEN_TWICE, a blob that is not UTF-8 text 400 BLOB_NOT_TEXT.
curl --request POST \
--url https://api.eddy.engineer/v1/earthing.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"frame": {},
"blob": "<string>",
"depth_m": 123,
"include_document": true,
"into_key": "<string>",
"method": "<string>",
"name": "<string>",
"node_crossings": true,
"radius_m": 123,
"rod_length_m": 123,
"rod_radius_m": 123,
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/earthing.import"
payload = {
"frame": {},
"blob": "<string>",
"depth_m": 123,
"include_document": True,
"into_key": "<string>",
"method": "<string>",
"name": "<string>",
"node_crossings": True,
"radius_m": 123,
"rod_length_m": 123,
"rod_radius_m": 123,
"text": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
frame: {},
blob: '<string>',
depth_m: 123,
include_document: true,
into_key: '<string>',
method: '<string>',
name: '<string>',
node_crossings: true,
radius_m: 123,
rod_length_m: 123,
rod_radius_m: 123,
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/earthing.import', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/earthing.import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'frame' => [
],
'blob' => '<string>',
'depth_m' => 123,
'include_document' => true,
'into_key' => '<string>',
'method' => '<string>',
'name' => '<string>',
'node_crossings' => true,
'radius_m' => 123,
'rod_length_m' => 123,
'rod_radius_m' => 123,
'text' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eddy.engineer/v1/earthing.import"
payload := strings.NewReader("{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.eddy.engineer/v1/earthing.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/earthing.import")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"frame\": {},\n \"blob\": \"<string>\",\n \"depth_m\": 123,\n \"include_document\": true,\n \"into_key\": \"<string>\",\n \"method\": \"<string>\",\n \"name\": \"<string>\",\n \"node_crossings\": true,\n \"radius_m\": 123,\n \"rod_length_m\": 123,\n \"rod_radius_m\": 123,\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
TL3c: a blob id (b3:<64 hex>: an upload's blob_id, an attachment's blob) holding the file, instead of text: read as the caller under the read gate (a blob the caller may not read answers 404 BLOB_NOT_FOUND, as an absent one) and imported exactly as if its contents were sent inline. Give one of the two (both: 400 FILE_GIVEN_TWICE).
The file's contents
Response
schema, kind, key, blob_uri, counts, validation, format, import_findings, document
The response is of type object.