Retrieve a list of voucher groups
curl --request GET \
--url https://api.spirii.com/voucher-groupsimport requests
url = "https://api.spirii.com/voucher-groups"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spirii.com/voucher-groups', 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/voucher-groups",
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/voucher-groups"
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/voucher-groups")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/voucher-groups")
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": 24,
"name": "AKB2022",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": 0.5,
"createdAt": "2021-01-07T09:21:43.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
},
{
"id": 25,
"name": "aura2021",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": null,
"createdAt": "2021-04-07T11:41:23.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
}
],
"totalElements": 207,
"offset": 10,
"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 voucher groups
GET
/
voucher-groups
Retrieve a list of voucher groups
curl --request GET \
--url https://api.spirii.com/voucher-groupsimport requests
url = "https://api.spirii.com/voucher-groups"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.spirii.com/voucher-groups', 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/voucher-groups",
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/voucher-groups"
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/voucher-groups")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.spirii.com/voucher-groups")
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": 24,
"name": "AKB2022",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": 0.5,
"createdAt": "2021-01-07T09:21:43.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
},
{
"id": 25,
"name": "aura2021",
"perKwh": 2.5,
"currency": "DKK",
"isSpotPriceBased": false,
"spotPriceMargin": null,
"spotPriceMarginPct": null,
"spotPriceMinimum": null,
"createdAt": "2021-04-07T11:41:23.000Z",
"updatedAt": "2022-11-07T05:56:18.000Z",
"voucherCount": 1
}
],
"totalElements": 207,
"offset": 10,
"limit": 2
}{
"error": {
"message": "Querystring parameter `id` is not allowed",
"statusCode": 400,
"code": "QueryParamNotAllowed"
}
}{
"error": {
"message": "Something went wroing, try again later",
"statusCode": 500
}
}Was this page helpful?