Read a site change
curl --request GET \
--url https://api.spreadjam.com/v1/site-changes/{changeId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spreadjam.com/v1/site-changes/{changeId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spreadjam.com/v1/site-changes/{changeId}', 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.spreadjam.com/v1/site-changes/{changeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.spreadjam.com/v1/site-changes/{changeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spreadjam.com/v1/site-changes/{changeId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/site-changes/{changeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "preparing",
"repository": "<string>",
"baseBranch": "<string>",
"filePath": "<string>",
"createsFile": true,
"summary": "<string>",
"prUrl": "<string>",
"prNumber": 123,
"failureMessage": "<string>",
"fallback": "copy_prompt",
"hunks": [
{
"oldStart": 123,
"oldLines": 123,
"newStart": 123,
"newLines": 123,
"lines": [
{
"kind": "context",
"text": "<string>"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Site changes
Read a site change
One code change Jam prepared, with its before/after preview (hunks). Poll it after POST /v1/actions/{actionId}/executions until it leaves preparing (usually a minute or two).
GET
/
v1
/
site-changes
/
{changeId}
Read a site change
curl --request GET \
--url https://api.spreadjam.com/v1/site-changes/{changeId} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.spreadjam.com/v1/site-changes/{changeId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.spreadjam.com/v1/site-changes/{changeId}', 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.spreadjam.com/v1/site-changes/{changeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.spreadjam.com/v1/site-changes/{changeId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.spreadjam.com/v1/site-changes/{changeId}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spreadjam.com/v1/site-changes/{changeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"actionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "preparing",
"repository": "<string>",
"baseBranch": "<string>",
"filePath": "<string>",
"createsFile": true,
"summary": "<string>",
"prUrl": "<string>",
"prNumber": 123,
"failureMessage": "<string>",
"fallback": "copy_prompt",
"hunks": [
{
"oldStart": 123,
"oldLines": 123,
"newStart": 123,
"newLines": 123,
"lines": [
{
"kind": "context",
"text": "<string>"
}
]
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"requestId": "<string>",
"docs": "<string>",
"resolveUrl": "<string>",
"details": [
{}
]
}Authorizations
Response
object | null
The change.
The latest code change Jam prepared for this action (page edits and technical fixes), with its preview. Null when none.
preparing: Jam is finding the file and writing the edit. proposed: ready; read hunks, then open the pull request or discard it. opening: the pull request is being opened. in_review: the pull request is open (prUrl). merged / closed: what happened to it. failed: Jam could not make it (failureMessage). stale: the file changed since; prepare it again. discarded: dropped.
Available options:
preparing, proposed, opening, in_review, merged, closed, failed, stale, discarded