curl --request POST \
--url https://api.eddy.engineer/v1/practice.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"created_at": "<string>",
"base": "<string>",
"pack": {},
"proposed_by": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/practice.import"
payload = {
"created_at": "<string>",
"base": "<string>",
"pack": {},
"proposed_by": "<string>",
"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({
created_at: '<string>',
base: '<string>',
pack: {},
proposed_by: '<string>',
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/practice.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/practice.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([
'created_at' => '<string>',
'base' => '<string>',
'pack' => [
],
'proposed_by' => '<string>',
'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/practice.import"
payload := strings.NewReader("{\n \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\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/practice.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/practice.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 \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"adopted_rev": "<string>",
"answers": 123,
"item_id": "<string>",
"pack_key": "<string>",
"rev": "<string>",
"state": "<string>",
"values": 123
}An organisation's own practice pack (`ss.practice/1`) as the working revision of its item (R4)
A practice pack is your organisation’s own practice, never a standard’s: answers to the engine’s typed questions (code, an optional scope such as {plant}, choice, why), values for our labelled starting values (param a key GET /v1/ladders lists, value in its own unit, why) and orders. Give pack (an object) or text (a JSON file’s contents). Refused by name: PRACTICE_CITES_STANDARD (a standard, edition or clause field anywhere), PRACTICE_SHAPE, PRACTICE_ID, PRACTICE_PARAM_UNKNOWN, PRACTICE_PARAM_NOT_SETTABLE (ours, but no brief carries it yet; settable today: the layout’s air limits), PRACTICE_UNIT (nothing is converted), PRACTICE_OUT_OF_BOUNDS (the brief validator’s own bounds), PRACTICE_CODE_UNKNOWN, PRACTICE_CHOICE_UNKNOWN, PRACTICE_SCOPE, PRACTICE_DUPLICATE, PRACTICE_WHY; the message lists every problem. The item is practice:~<org>:<id>; a new version of an adopted pack is a new revision of it, with no ECO, and the adopted revision stays in force until a person adopts the new one. proposed_by is bound to the caller: a signed-in person may omit it (their own name is recorded), and naming someone else is refused (ACTOR_MISMATCH, 403). R8: base names the content key of the head the caller read (/v1/practice.list’s pack_key); a head that moved since is refused (PRACTICE_HEAD_MOVED, 409). A member’s import carries over the candidates hidden from them, and an answer to a member names no pack_key while the stored head holds another’s candidate (D10).
curl --request POST \
--url https://api.eddy.engineer/v1/practice.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"created_at": "<string>",
"base": "<string>",
"pack": {},
"proposed_by": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/practice.import"
payload = {
"created_at": "<string>",
"base": "<string>",
"pack": {},
"proposed_by": "<string>",
"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({
created_at: '<string>',
base: '<string>',
pack: {},
proposed_by: '<string>',
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/practice.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/practice.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([
'created_at' => '<string>',
'base' => '<string>',
'pack' => [
],
'proposed_by' => '<string>',
'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/practice.import"
payload := strings.NewReader("{\n \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\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/practice.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/practice.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 \"created_at\": \"<string>\",\n \"base\": \"<string>\",\n \"pack\": {},\n \"proposed_by\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"adopted_rev": "<string>",
"answers": 123,
"item_id": "<string>",
"pack_key": "<string>",
"rev": "<string>",
"state": "<string>",
"values": 123
}