更新邊
curl --request PATCH \
--url https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}"
payload = {
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: '<string>', target: '<string>', condition: '<string>'})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}', 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.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'source' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body更新邊
更新邊的條件、來源或目標
PATCH
/
v1
/
projects
/
{projectId}
/
pathway
/
edges
/
{edgeId}
更新邊
curl --request PATCH \
--url https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId} \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
'import requests
url = "https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}"
payload = {
"source": "<string>",
"target": "<string>",
"condition": "<string>"
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({source: '<string>', target: '<string>', condition: '<string>'})
};
fetch('https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}', 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.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'source' => '<string>',
'target' => '<string>',
'condition' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"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.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}"
payload := strings.NewReader("{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<authorization>")
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.patch("https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source\": \"<string>\",\n \"target\": \"<string>\",\n \"condition\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body請求
PATCH https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId}
路徑參數
專案 ID
邊 ID
標頭
使用您的 Developer Key 進行 Bearer 令牌認證
請求主體
所有欄位皆為選填。只需包含您想更新的欄位。新的來源節點 ID
新的目標節點 ID
更新後的轉換條件
回應
回傳完整的更新後邊。若新的來源或目標節點不存在,則回傳400。
範例
curl -X PATCH https://api.pathors.com/v1/projects/{projectId}/pathway/edges/{edgeId} \
-H "Authorization: Bearer dk_your_key" \
-H "Content-Type: application/json" \
-d '{
"condition": "User confirms booking and provides payment"
}'
⌘I
