Updating Transcription Content

๐Ÿ’พ Update Transcription Content

After editing your transcription content you can update an existing transcription.

import requests
import json

url = "https://api.transkriptor.com/9/Update-Transcription"

#your api key
parameters = {
    "orderid" : "XXXXXX"
}
headers = {}
headers["Content-Type"] = "application/json"

# This one is an example format of new content. You should just change the texts in "text" field.
newContent = {"content": [{"StartTime": 1840, "EndTime": 6840, "VoiceStart": 1840, "VoiceEnd": 6840, "Speaker": "SPK_1", "text": "Hi how are you?"}]}

resp = requests.get(url, params=parameters, headers=headers, data=json.dumps(newContent))

print(resp.status_code)
const url = new URL("https://api.transkriptor.com/9/Update-Transcription");
url.searchParams.append("orderid", "XXXXXX");

const headers = {
  "Content-Type": "application/json",
};

const newContent = {
  content: [
    {
      StartTime: 1840,
      EndTime: 6840,
      VoiceStart: 1840,
      VoiceEnd: 6840,
      Speaker: "SPK_1",
      text: "Hi how are you?",
    },
  ],
};

fetch(url, {
  method: "GET",
  headers: headers,
  body: JSON.stringify(newContent),
})
  .then((response) => console.log(response.status))
  .catch((error) => console.error('Error:', error));

import java.net.HttpURLConnection;
import java.net.URL;
import java.io.OutputStream;

public class Main {
  public static void main(String[] args) throws Exception {
    URL url = new URL("https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX");
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    conn.setRequestMethod("GET");
    conn.setRequestProperty("Content-Type", "application/json");
    conn.setDoOutput(true);

    String newContent = "{\"content\":[{\"StartTime\":1840,\"EndTime\":6840,\"VoiceStart\":1840,\"VoiceEnd\":6840,\"Speaker\":\"SPK_1\",\"text\":\"Hi how are you?\"}]}";
    OutputStream os = conn.getOutputStream();
    os.write(newContent.getBytes());
    os.close();

    System.out.println(conn.getResponseCode());
  }
}

using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;

class Program {
  static async Task Main(string[] args) {
    using (HttpClient client = new HttpClient()) {
      client.DefaultRequestHeaders.Add("Content-Type", "application/json");
      var newContent = new {
        content = new[] {
          new {
            StartTime = 1840,
            EndTime = 6840,
            VoiceStart = 1840,
            VoiceEnd = 6840,
            Speaker = "SPK_1",
            text = "Hi how are you?",
          }
        }
      };

      var url = "https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX";
      HttpResponseMessage response

package main

import (
	"bytes"
	"encoding/json"
	"fmt"
	"net/http"
)

func main() {
	url := "https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX"
	newContent := map[string][]map[string]interface{}{
		"content": {
			{
				"StartTime":  1840,
				"EndTime":    6840,
				"VoiceStart": 1840,
				"VoiceEnd":   6840,
				"Speaker":    "SPK_1",
				"text":       "Hi how are you?",
			},
		},
	}
	jsonData, _ := json.Marshal(newContent)

	req, _ := http.NewRequest("GET", url, bytes.NewBuffer(jsonData))
	req.Header.Set("Content-Type", "application/json")

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()

	fmt.Println(resp.StatusCode)
}

require 'net/http'
require 'json'

url = URI("https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Content-Type"] = "application/json"
newContent = {
  content: [
    {
      StartTime: 1840,
      EndTime: 6840,
      VoiceStart: 1840,
      VoiceEnd: 6840,
      Speaker: "SPK_1",
      text: "Hi how are you?",
    },
  ],
}.to_json
request.body = newContent

response = http.request(request)
puts response.code

<?php

$url = "https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX";
$newContent = json_encode(array(
  "content" => array(
    array(
      "StartTime" => 1840,
      "EndTime" => 6840,
      "VoiceStart" => 1840,
      "VoiceEnd" => 6840,
      "Speaker" => "SPK_1",
      "text" => "Hi how are you?",
    ),
  ),
));

$headers = array(
  "Content-Type: application/json",
);

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_POSTFIELDS, $newContent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
print_r($status_code);

curl_close($ch);
?>

import java.net.HttpURLConnection
import java.net.URL
import java.io.OutputStream

fun main() {
    val url = URL("https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX")
    val conn = url.openConnection() as HttpURLConnection
    conn.requestMethod = "GET"
    conn.setRequestProperty("Content-Type", "application/json")
    conn.doOutput = true

    val newContent = "{\"content\":[{\"StartTime\":1840,\"EndTime\":6840,\"VoiceStart\":1840,\"VoiceEnd\":6840,\"Speaker\":\"SPK_1\",\"text\":\"Hi how are you?\"}]}"
    val os: OutputStream = conn.outputStream
    os.write(newContent.toByteArray())
    os.close()

    println(conn.responseCode)
}

import Foundation

var urlComponents = URLComponents(string: "https://api.transkriptor.com/9/Update-Transcription")!
urlComponents.queryItems = [
    URLQueryItem(name: "orderid", value: "XXXXXX"),
]
var request = URLRequest(url: urlComponents.url!)
request.httpMethod = "GET"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let newContent: [String: Any] = [
    "content": [
        [
            "StartTime": 1840,
            "EndTime": 6840,
            "VoiceStart": 1840,
            "VoiceEnd": 6840,
            "Speaker": "SPK_1",
            "text": "Hi how are you?",
        ]
   

    val newContent = "{\"content\":[{\"StartTime\":1840,\"EndTime\":6840,\"VoiceStart\":1840,\"VoiceEnd\":6840,\"Speaker\":\"SPK_1\",\"text\":\"Hi how are you?\"}]}"
    val os: OutputStream = conn.outputStream
    os.write(newContent.toByteArray())
    os.close()

    println(conn.responseCode)
}

import 'dart:convert';
import 'dart:io';

void main() async {
  var url = Uri.parse('https://api.transkriptor.com/9/Update-Transcription?orderid=XXXXXX');

  var newContent = {
    'content': [
      {
        'StartTime': 1840,
        'EndTime': 6840,
        'VoiceStart': 1840,
        'VoiceEnd': 6840,
        'Speaker': 'SPK_1',
        'text': 'Hi how are you?',
      },
    ],
  };

  var request = HttpClientRequest()
    ..uri = url
    ..method = 'GET'
    ..headers.contentType = ContentType.json
    ..write(jsonEncode(newContent));

  var response = await (await HttpClient().openUrl('GET', url)).close();
  print(response.statusCode);
}