Upload media
curl --request POST \
--url https://truecaller.udchowdhury.me/v1/media \
--header 'Content-Type: image/jpeg' \
--header 'x-api-key: <api-key>' \
--data '<string>'import requests
url = "https://truecaller.udchowdhury.me/v1/media"
payload = "<string>"
headers = {
"x-api-key": "<api-key>",
"Content-Type": "image/jpeg"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'image/jpeg'},
body: '<string>'
};
fetch('https://truecaller.udchowdhury.me/v1/media', 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://truecaller.udchowdhury.me/v1/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: image/jpeg",
"x-api-key: <api-key>"
],
]);
$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://truecaller.udchowdhury.me/v1/media"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "image/jpeg")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://truecaller.udchowdhury.me/v1/media")
.header("x-api-key", "<api-key>")
.header("Content-Type", "image/jpeg")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://truecaller.udchowdhury.me/v1/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'image/jpeg'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://truecaller.udchowdhury.me/m/1c9e…/invoice.pdf",
"mime_type": "application/pdf",
"file_name": "invoice.pdf",
"size": 48213
}{
"error": "<string>",
"details": [
{}
]
}Templates
Upload media
Upload an image, video or file to attach to templates.
POST
/
v1
/
media
Upload media
curl --request POST \
--url https://truecaller.udchowdhury.me/v1/media \
--header 'Content-Type: image/jpeg' \
--header 'x-api-key: <api-key>' \
--data '<string>'import requests
url = "https://truecaller.udchowdhury.me/v1/media"
payload = "<string>"
headers = {
"x-api-key": "<api-key>",
"Content-Type": "image/jpeg"
}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'image/jpeg'},
body: '<string>'
};
fetch('https://truecaller.udchowdhury.me/v1/media', 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://truecaller.udchowdhury.me/v1/media",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => "<string>",
CURLOPT_HTTPHEADER => [
"Content-Type: image/jpeg",
"x-api-key: <api-key>"
],
]);
$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://truecaller.udchowdhury.me/v1/media"
payload := strings.NewReader("<string>")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "image/jpeg")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://truecaller.udchowdhury.me/v1/media")
.header("x-api-key", "<api-key>")
.header("Content-Type", "image/jpeg")
.body("<string>")
.asString();require 'uri'
require 'net/http'
url = URI("https://truecaller.udchowdhury.me/v1/media")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'image/jpeg'
request.body = "<string>"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "https://truecaller.udchowdhury.me/m/1c9e…/invoice.pdf",
"mime_type": "application/pdf",
"file_name": "invoice.pdf",
"size": 48213
}{
"error": "<string>",
"details": [
{}
]
}curl -X POST https://truecaller.udchowdhury.me/v1/media \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/pdf" \
-H "x-file-name: invoice.pdf" \
--data-binary @invoice.pdf
url, mime_type and file_name into a template’s media. You can also use
any public https link instead of uploading.Authorizations
Workspace API key from Developers → API keys. It starts with tc_live_.
Headers
File name, URL-encoded, e.g. invoice.pdf.
Body
image/jpegimage/pngimage/gifvideo/mp4video/quicktimeapplication/pdftext/plain
The body is of type file.
Was this page helpful?

