Generate AI Content
curl --request POST \
--url https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa",
"mediaUrl": "https://example.com/audio.mp3",
"title": "Meeting Notes",
"language": "ar",
"aiParts": [
"summary"
],
"aiContentTitle": "Project Kickoff Summary",
"aiContentLanguage": "ar",
"aiContentDate": "2025-01-01T00:00:00.000Z",
"aiContentText": "Provide highlights focusing on action items."
}
'import requests
url = "https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content"
payload = {
"apiKey": "9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa",
"mediaUrl": "https://example.com/audio.mp3",
"title": "Meeting Notes",
"language": "ar",
"aiParts": ["summary"],
"aiContentTitle": "Project Kickoff Summary",
"aiContentLanguage": "ar",
"aiContentDate": "2025-01-01T00:00:00.000Z",
"aiContentText": "Provide highlights focusing on action items."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
apiKey: '9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa',
mediaUrl: 'https://example.com/audio.mp3',
title: 'Meeting Notes',
language: 'ar',
aiParts: ['summary'],
aiContentTitle: 'Project Kickoff Summary',
aiContentLanguage: 'ar',
aiContentDate: '2025-01-01T00:00:00.000Z',
aiContentText: 'Provide highlights focusing on action items.'
})
};
fetch('https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content', 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.tryhamsa.com/v2/jobs/generate-transcription-ai-content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'apiKey' => '9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa',
'mediaUrl' => 'https://example.com/audio.mp3',
'title' => 'Meeting Notes',
'language' => 'ar',
'aiParts' => [
'summary'
],
'aiContentTitle' => 'Project Kickoff Summary',
'aiContentLanguage' => 'ar',
'aiContentDate' => '2025-01-01T00:00:00.000Z',
'aiContentText' => 'Provide highlights focusing on action items.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v2/jobs/generate-transcription-ai-content"
payload := strings.NewReader("{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "AI Content started, you will receive en email when it's ready",
"messageKey": "OPERATION_SUCCESSFUL",
"data": {
"jobId": "ed9b5601-f731-441a-8500-d9fc7610ef8f"
}
}{
"code": 9400,
"message": "The Media Url field is required!",
"messageKey": "FieldMustBeString"
}{
"success": false,
"code": 500,
"message": "Internal server error"
}AI Docs Routes
Generate AI Content
Submit a transcription job that also generates AI content based on provided parts.
POST
/
v2
/
jobs
/
generate-transcription-ai-content
Generate AI Content
curl --request POST \
--url https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"apiKey": "9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa",
"mediaUrl": "https://example.com/audio.mp3",
"title": "Meeting Notes",
"language": "ar",
"aiParts": [
"summary"
],
"aiContentTitle": "Project Kickoff Summary",
"aiContentLanguage": "ar",
"aiContentDate": "2025-01-01T00:00:00.000Z",
"aiContentText": "Provide highlights focusing on action items."
}
'import requests
url = "https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content"
payload = {
"apiKey": "9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa",
"mediaUrl": "https://example.com/audio.mp3",
"title": "Meeting Notes",
"language": "ar",
"aiParts": ["summary"],
"aiContentTitle": "Project Kickoff Summary",
"aiContentLanguage": "ar",
"aiContentDate": "2025-01-01T00:00:00.000Z",
"aiContentText": "Provide highlights focusing on action items."
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
apiKey: '9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa',
mediaUrl: 'https://example.com/audio.mp3',
title: 'Meeting Notes',
language: 'ar',
aiParts: ['summary'],
aiContentTitle: 'Project Kickoff Summary',
aiContentLanguage: 'ar',
aiContentDate: '2025-01-01T00:00:00.000Z',
aiContentText: 'Provide highlights focusing on action items.'
})
};
fetch('https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content', 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.tryhamsa.com/v2/jobs/generate-transcription-ai-content",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'apiKey' => '9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa',
'mediaUrl' => 'https://example.com/audio.mp3',
'title' => 'Meeting Notes',
'language' => 'ar',
'aiParts' => [
'summary'
],
'aiContentTitle' => 'Project Kickoff Summary',
'aiContentLanguage' => 'ar',
'aiContentDate' => '2025-01-01T00:00:00.000Z',
'aiContentText' => 'Provide highlights focusing on action items.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.tryhamsa.com/v2/jobs/generate-transcription-ai-content"
payload := strings.NewReader("{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.post("https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryhamsa.com/v2/jobs/generate-transcription-ai-content")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"apiKey\": \"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa\",\n \"mediaUrl\": \"https://example.com/audio.mp3\",\n \"title\": \"Meeting Notes\",\n \"language\": \"ar\",\n \"aiParts\": [\n \"summary\"\n ],\n \"aiContentTitle\": \"Project Kickoff Summary\",\n \"aiContentLanguage\": \"ar\",\n \"aiContentDate\": \"2025-01-01T00:00:00.000Z\",\n \"aiContentText\": \"Provide highlights focusing on action items.\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "AI Content started, you will receive en email when it's ready",
"messageKey": "OPERATION_SUCCESSFUL",
"data": {
"jobId": "ed9b5601-f731-441a-8500-d9fc7610ef8f"
}
}{
"code": 9400,
"message": "The Media Url field is required!",
"messageKey": "FieldMustBeString"
}{
"success": false,
"code": 500,
"message": "Internal server error"
}Authorizations
Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '
Body
application/json
Request body containing media info and AI content options
API key identifier (used for API key authorization)
Example:
"9f5f1f6a-2b1d-4a33-8fd4-6f5c2b89e3aa"
URL of the media to transcribe
Minimum string length:
1Example:
"https://example.com/audio.mp3"
Required string length:
1 - 500Example:
"Meeting Notes"
Language code for the media being transcribed
Available options:
ar, en Example:
"ar"
AI content parts to generate (one key only)
Required array length:
1 elementMinimum string length:
1Example:
["summary"]
Required string length:
1 - 500Example:
"Project Kickoff Summary"
Preferred AI content language
Available options:
ar, en, both_ar_first, both_en_first Example:
"ar"
Date associated with the AI content
Example:
"2025-01-01T00:00:00.000Z"
Required string length:
1 - 5000Example:
"Provide highlights focusing on action items."
Was this page helpful?
⌘I