Repositories
curl --request POST \
--url https://win.oneshotagent.com/v1/connectionsimport requests
url = "https://win.oneshotagent.com/v1/connections"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/connections', 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://win.oneshotagent.com/v1/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/connections"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/connections")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyConnections
Repositories
Let an agent work inside your repositories on a limited token you can revoke
POST
/
v1
/
connections
Repositories
curl --request POST \
--url https://win.oneshotagent.com/v1/connectionsimport requests
url = "https://win.oneshotagent.com/v1/connections"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://win.oneshotagent.com/v1/connections', 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://win.oneshotagent.com/v1/connections",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://win.oneshotagent.com/v1/connections"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://win.oneshotagent.com/v1/connections")
.asString();require 'uri'
require 'net/http'
url = URI("https://win.oneshotagent.com/v1/connections")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOverview
Connections are in limited preview and apply to goals on the agent loop.
Connect
POST /v1/connections with a signed write proof (Authentication schemes).
{ "name": "acme-github", "kind": "github" }
name and kind. Open link, approve on GitHub and choose repositories: they become the scope of the active connection. The link works once, for an hour.
For a business system:
{ "name": "acme-books", "kind": "app", "system": "quickbooks" }
system is a catalogue id other than github. Unavailable: 503 not_configured, nothing created; extra fields: 400 invalid_request. Approve on the system’s page; only an active account belonging to this connection is activated (403 not_owner otherwise). Connections to one system take different names.
Read-only tools require an active connection_id: accounting, CRM, tax and shipping. Nothing fetched is stored.
For a system that authorizes with a key, send it with the start:
{ "name": "acme-tax", "kind": "app", "system": "taxjar", "api_key": "<your TaxJar key>" }
active, link null, credential: "stored". A refused key: 400 key_refused, nothing stored; api_key elsewhere: 400 invalid_request. Systems: taxjar, shipengine.
List and revoke
GET /v1/connections:status(pending,active,expired,revoked),system,account_label(may be null),scope.repositories, andcredential: "stored"when an encrypted credential exists.DELETE /v1/connections/{id}: the next use fails; the system grant is ended where possible and any stored credential deleted.POST /v1/connections/{id}/reconnect: one-hour sign-in link forexpiredconnections or active CRM connections missing write permission; otherwise409 not_expired. Key-authorized connections may sendapi_key, returningactivewithout a link.
expired, a disconnected account revoked.
Uninstalling the application on GitHub also revokes it.