curl --request POST \
--url https://api.eddy.engineer/v1/apps/{id}/token \
--header 'Content-Type: application/json' \
--data '
{
"rev": "<string>",
"replaces": "<string>",
"ttl_s": 123
}
'import requests
url = "https://api.eddy.engineer/v1/apps/{id}/token"
payload = {
"rev": "<string>",
"replaces": "<string>",
"ttl_s": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({rev: '<string>', replaces: '<string>', ttl_s: 123})
};
fetch('https://api.eddy.engineer/v1/apps/{id}/token', 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/apps/{id}/token",
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([
'rev' => '<string>',
'replaces' => '<string>',
'ttl_s' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/apps/{id}/token"
payload := strings.NewReader("{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/apps/{id}/token")
.header("Content-Type", "application/json")
.body("{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/apps/{id}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}"
response = http.request(request)
puts response.read_body{
"app": {},
"expires_at_unix_ms": 123,
"open": true,
"record": {},
"scopes": [
"<string>"
],
"token": "<string>"
}Mint an app revision's token (AS6)
The person running a revision mints its delegated token: app:<id>@<rev>, the revision’s own scopes, acting for them and on their audit trail (AS2), for at most 15 minutes; the host page hands it to the app by postMessage and refreshes it. Only a signed-in person who may see the app; a revision of another app is not found; an app that names no scopes gets no token. On an engine without sign-in the answer is open and no token. TL2: a revision that declares an agent pins it on the token (its id and spec hash: the screen runs that agent as it is now, and no other) and answers its id as agent and app.agent (the host page hands app to the screen, which reads eddy.app.agent; absent when the revision declares none), with agent_view as the consent screen lists it (available: false when it is not an agent the app’s author owns in the app’s org: then nothing is pinned); consent covers the agent’s spec hash beside the scopes.
curl --request POST \
--url https://api.eddy.engineer/v1/apps/{id}/token \
--header 'Content-Type: application/json' \
--data '
{
"rev": "<string>",
"replaces": "<string>",
"ttl_s": 123
}
'import requests
url = "https://api.eddy.engineer/v1/apps/{id}/token"
payload = {
"rev": "<string>",
"replaces": "<string>",
"ttl_s": 123
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({rev: '<string>', replaces: '<string>', ttl_s: 123})
};
fetch('https://api.eddy.engineer/v1/apps/{id}/token', 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/apps/{id}/token",
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([
'rev' => '<string>',
'replaces' => '<string>',
'ttl_s' => 123
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/apps/{id}/token"
payload := strings.NewReader("{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}")
req, _ := http.NewRequest("POST", url, payload)
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/apps/{id}/token")
.header("Content-Type", "application/json")
.body("{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/apps/{id}/token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"rev\": \"<string>\",\n \"replaces\": \"<string>\",\n \"ttl_s\": 123\n}"
response = http.request(request)
puts response.read_body{
"app": {},
"expires_at_unix_ms": 123,
"open": true,
"record": {},
"scopes": [
"<string>"
],
"token": "<string>"
}