curl --request GET \
--url https://api.onsleek.ai/v1/deals/coupons/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onsleek.ai/v1/deals/coupons/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onsleek.ai/v1/deals/coupons/{id}', 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.onsleek.ai/v1/deals/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.onsleek.ai/v1/deals/coupons/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onsleek.ai/v1/deals/coupons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onsleek.ai/v1/deals/coupons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "ea0efd78-2c3c-4efd-9e92-1ab676ee304b",
"code": "SAVE20",
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-12-31T23:59:59.999Z",
"description": "Use SAVE20 coupon code to get 20% off.",
"retailerId": "4f9df53d-16dc-4630-8603-8d14ec40fcfe",
"url": "https://www.bestbuy.com",
"name": "BestBuy",
"hostname": "www.bestbuy.com",
"updatedAt": "2024-01-01T12:00:00.000Z",
"logo": "https://www.bestbuy.com/logo.png"
}Get coupon by ID
Get coupon by ID.
curl --request GET \
--url https://api.onsleek.ai/v1/deals/coupons/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.onsleek.ai/v1/deals/coupons/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.onsleek.ai/v1/deals/coupons/{id}', 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.onsleek.ai/v1/deals/coupons/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.onsleek.ai/v1/deals/coupons/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.onsleek.ai/v1/deals/coupons/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.onsleek.ai/v1/deals/coupons/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "ea0efd78-2c3c-4efd-9e92-1ab676ee304b",
"code": "SAVE20",
"startDate": "2024-01-01T00:00:00.000Z",
"endDate": "2024-12-31T23:59:59.999Z",
"description": "Use SAVE20 coupon code to get 20% off.",
"retailerId": "4f9df53d-16dc-4630-8603-8d14ec40fcfe",
"url": "https://www.bestbuy.com",
"name": "BestBuy",
"hostname": "www.bestbuy.com",
"updatedAt": "2024-01-01T12:00:00.000Z",
"logo": "https://www.bestbuy.com/logo.png"
}Authorizations
API key for accessing the Sleek API.
Path Parameters
The ID of the coupon to fetch.
Response
Coupon by id.
The unique identifier for the coupon. Format: UUID RFC 4122
"ea0efd78-2c3c-4efd-9e92-1ab676ee304b"
The coupon code value.
"SAVE20"
The date and time when the coupon becomes active. Format: ISO 8601
"2024-01-01T00:00:00.000Z"
The date and time when the coupon expires. Format: ISO 8601
"2024-12-31T23:59:59.999Z"
The description of the coupon.
"Use SAVE20 coupon code to get 20% off."
The ID of the retailer associated with the coupon offer. Format: UUID RFC 4122
"4f9df53d-16dc-4630-8603-8d14ec40fcfe"
The URL of the retailer's website where the coupon can be used.
"https://www.bestbuy.com"
The name of the retailer associated with the coupon.
"BestBuy"
The hostname of the retailer's website.
"www.bestbuy.com"
The date and time when the coupon was last updated. Format: ISO 8601
"2024-01-01T12:00:00.000Z"
The URL of the retailer's logo associated with the coupon.
"https://www.bestbuy.com/logo.png"

