Retrieve a list of vouchers
curl --request GET \
--url https://api.spirii.com/vouchersimport requests
url = "https://api.spirii.com/vouchers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spirii.com/vouchers', 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.spirii.com/vouchers",
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://api.spirii.com/vouchers"
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://api.spirii.com/vouchers")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/vouchers")
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{
"data": [
{
"id": 1,
"groupId": 141,
"code": "sp1r112020",
"maxUsers": 6,
"createdAt": "2020-10-20T04:19:03.000Z",
"updatedAt": "2022-09-29T03:57:50.000Z",
"expiresAt": "2024-07-22T05:26:16.000Z"
},
{
"id": 2,
"groupId": 121,
"code": "RH37491",
"maxUsers": null,
"createdAt": "2020-10-26T08:41:12.000Z",
"updatedAt": "2022-01-18T12:13:57.000Z",
"expiresAt": null
}
],
"totalElements": 4158,
"offset": 0,
"limit": 2
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Retrieve a list of vouchers
GET
/
vouchers
Retrieve a list of vouchers
curl --request GET \
--url https://api.spirii.com/vouchersimport requests
url = "https://api.spirii.com/vouchers"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spirii.com/vouchers', 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.spirii.com/vouchers",
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://api.spirii.com/vouchers"
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://api.spirii.com/vouchers")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/vouchers")
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{
"data": [
{
"id": 1,
"groupId": 141,
"code": "sp1r112020",
"maxUsers": 6,
"createdAt": "2020-10-20T04:19:03.000Z",
"updatedAt": "2022-09-29T03:57:50.000Z",
"expiresAt": "2024-07-22T05:26:16.000Z"
},
{
"id": 2,
"groupId": 121,
"code": "RH37491",
"maxUsers": null,
"createdAt": "2020-10-26T08:41:12.000Z",
"updatedAt": "2022-01-18T12:13:57.000Z",
"expiresAt": null
}
],
"totalElements": 4158,
"offset": 0,
"limit": 2
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Query Parameters
Expiration date in ISO timestamp (UTC)
Example:
"2022-01-20T08:08:24.878Z"
The number of items to skip before starting to collect the result set
Example:
250
Number of record to collect
Required range:
x <= 2000Example:
250
Response
Voucher list
Voucher list
Show child attributes
Show child attributes
Was this page helpful?