foreign-sapphire•14mo ago
Cannot Patch Transcript
API - https://developer.voiceflow.com/reference/patch_transcripts-projectid-transcriptid
I am trying to update Name in the trasncript using the API.
I added projectID, transcriptID (both fetch from Fetch Project Transcripts) and name (single or double word)
I used the API key that i used previously to fetch.
I am constnatly getting error.
{
"code": 500,
"status": "Internal Server Error",
"dateTime": "2024-07-08T16:53:05.180Z",
"timestamp": 1720457585180,
"data": "Document failed validation"
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.voiceflow.com/v2/transcripts/PROJECTID/TRANSCRIPTID",
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([
'data' => [
'name' => 'NAME'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: API-KEY",
"accept: application/json",
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
1 Reply
Something like this should work:
I didn't test it and you would need to replace projectID and transcriptID. Let me know if it works 🙂