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.
NetSuite and Coupa require client. Zoho Books requires region, the ending of your Zoho address (com, eu, in, com.au, jp, ca, sa, com.cn), since a sign-in is valid only there. Other systems refuse both:
{ "name": "sandbox", "kind": "app", "system": "netsuite", "client": { "account_id": "12345_SB1", "client_id": "<client ID>", "client_secret": "<client secret>" } }
{ "name": "acme-books", "kind": "app", "system": "zoho_books", "region": "eu" }
400 region_required until one is sent.
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>" }
api_secret, where paired) is stored encrypted and connects the account at once: active, link null, credential: "stored". A refused key: 400 key_refused, nothing stored; api_key elsewhere: 400 invalid_request.
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 sendapi_key(andapi_secret), returningactive, no link.
expired, a disconnected account revoked.
GitHub uninstall also revokes access.