Prêmios
Listar Recompensas
Lista as recompensas disponíveis para resgate
GET
/
api
/
v1
/
public
/
rewards
Listar recompensas
curl --request GET \
--url https://api.indiqai.com/api/v1/public/rewards \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://api.indiqai.com/api/v1/public/rewards"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://api.indiqai.com/api/v1/public/rewards', 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.indiqai.com/api/v1/public/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-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"
"net/http"
"io"
)
func main() {
url := "https://api.indiqai.com/api/v1/public/rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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.indiqai.com/api/v1/public/rewards")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiqai.com/api/v1/public/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"rewards": [
{
"uid": "rwd_001",
"name": "Pizza Margherita Grátis",
"description": "Uma pizza margherita média de cortesia",
"points_cost": 500,
"image_url": "https://storage.indiqai.com/rewards/pizza.jpg",
"available": true,
"stock": 10,
"category": "Alimentação"
},
{
"uid": "rwd_002",
"name": "10% de Desconto",
"description": "Desconto de 10% em qualquer pedido",
"points_cost": 200,
"image_url": null,
"available": true,
"stock": null,
"category": "Desconto"
}
],
"total": 2
}
{
"detail": "API Key inválida ou não fornecida"
}
Listar Recompensas
Retorna as recompensas (prêmios) disponíveis para resgate pelos clientes da empresa.Request
curl -X GET "https://api.indiqai.com/api/v1/public/rewards" \
-H "X-API-Key: indiqai_sua_chave_aqui"
const response = await fetch('https://api.indiqai.com/api/v1/public/rewards', {
headers: { 'X-API-Key': 'indiqai_sua_chave_aqui' }
});
const data = await response.json();
import httpx
response = httpx.get(
'https://api.indiqai.com/api/v1/public/rewards',
headers={'X-API-Key': 'indiqai_sua_chave_aqui'}
)
data = response.json()
Response
{
"rewards": [
{
"uid": "rwd_001",
"name": "Pizza Margherita Grátis",
"description": "Uma pizza margherita média de cortesia",
"points_cost": 500,
"image_url": "https://storage.indiqai.com/rewards/pizza.jpg",
"available": true,
"stock": 10,
"category": "Alimentação"
},
{
"uid": "rwd_002",
"name": "10% de Desconto",
"description": "Desconto de 10% em qualquer pedido",
"points_cost": 200,
"image_url": null,
"available": true,
"stock": null,
"category": "Desconto"
}
],
"total": 2
}
{
"detail": "API Key inválida ou não fornecida"
}
Campos da Resposta
Was this page helpful?
⌘I
Listar recompensas
curl --request GET \
--url https://api.indiqai.com/api/v1/public/rewards \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://api.indiqai.com/api/v1/public/rewards"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://api.indiqai.com/api/v1/public/rewards', 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.indiqai.com/api/v1/public/rewards",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-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"
"net/http"
"io"
)
func main() {
url := "https://api.indiqai.com/api/v1/public/rewards"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
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.indiqai.com/api/v1/public/rewards")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.indiqai.com/api/v1/public/rewards")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"rewards": [
{
"uid": "rwd_001",
"name": "Pizza Margherita Grátis",
"description": "Uma pizza margherita média de cortesia",
"points_cost": 500,
"image_url": "https://storage.indiqai.com/rewards/pizza.jpg",
"available": true,
"stock": 10,
"category": "Alimentação"
},
{
"uid": "rwd_002",
"name": "10% de Desconto",
"description": "Desconto de 10% em qualquer pedido",
"points_cost": 200,
"image_url": null,
"available": true,
"stock": null,
"category": "Desconto"
}
],
"total": 2
}
{
"detail": "API Key inválida ou não fornecida"
}

