Cache the latest product details from TDMS.
curl --request GET \
--url https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}import requests
url = "https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}', 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://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"message": "Server Error"
}Caching
Cache the latest product details from TDMS.
Fetches the product’s last update timestamp and compares it with the cached version. If outdated, retrieves fresh product details from TDMS API and updates the cache.
GET
/
api
/
cache
/
product
/
{tdmsProductId}
Cache the latest product details from TDMS.
curl --request GET \
--url https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}import requests
url = "https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}', 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://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://confirmation.freelancetravel.com/api/cache/product/{tdmsProductId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"message": "Server Error"
}