Get chat diff contents
GET
CoderSessionTokenheader
Coder-Session-Token<token>chat*stringChat ID
Format
uuidorigin?stringRemote origin selecting the ref to diff
branch?stringGit branch selecting the ref to diff
OK
application/json- response
branch?stringchat_id?stringFormat
uuiddiff?stringprovider?stringpull_request_url?stringremote_origin?stringThe samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.
curl -X GET \ "$CODER_URL/api/v2/chats/{chat}/diff" \ -H "Coder-Session-Token: $CODER_SESSION_TOKEN"const { CODER_URL, CODER_SESSION_TOKEN } = process.env;const url = `${CODER_URL}/api/v2/chats/{chat}/diff`;const response = await fetch(url, { method: "GET", headers: { "Coder-Session-Token": CODER_SESSION_TOKEN, },});console.log(response.status, await response.text());import osimport requestsurl = os.environ["CODER_URL"] + "/api/v2/chats/{chat}/diff"token = os.environ["CODER_SESSION_TOKEN"]response = requests.get( url, headers={ "Coder-Session-Token": token, },)print(response.status_code, response.text)package mainimport ( "fmt" "io" "net/http" "os")func main() { url := os.Getenv("CODER_URL") + "/api/v2/chats/{chat}/diff" token := os.Getenv("CODER_SESSION_TOKEN") req, err := http.NewRequest(http.MethodGet, url, nil) if err != nil { panic(err) } req.Header.Set("Coder-Session-Token", token) resp, err := http.DefaultClient.Do(req) if err != nil { panic(err) } defer resp.Body.Close() out, err := io.ReadAll(resp.Body) if err != nil { panic(err) } fmt.Println(resp.Status, string(out))}Example Response200
{ "branch": "string", "chat_id": "efc9fe20-a1e5-4a8c-9c48-f1b30c1e4f86", "diff": "string", "provider": "string", "pull_request_url": "string", "remote_origin": "string"}