foreign-sapphire
foreign-sapphire14mo 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
W. Williams (SFT)
Something like this should work:
const url = 'https://api.voiceflow.com/v2/transcripts/projectID/transcriptID';
const options = {
method: 'PATCH',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({data: {name: 'John Doe'}})
};
const url = 'https://api.voiceflow.com/v2/transcripts/projectID/transcriptID';
const options = {
method: 'PATCH',
headers: {accept: 'application/json', 'content-type': 'application/json'},
body: JSON.stringify({data: {name: 'John Doe'}})
};
I didn't test it and you would need to replace projectID and transcriptID. Let me know if it works 🙂

Did you find this page helpful?