Listar Assinaturas
curl --request GET \
--url https://api.example.com/subscriptions \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.example.com/subscriptions"
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.example.com/subscriptions', 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.example.com/subscriptions",
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.example.com/subscriptions"
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.example.com/subscriptions")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/subscriptions")
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{
"data": [
{
"partner_id": "pa_10000",
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10000",
"beneficiary": {
"name": "João Silva",
"cpf": "34567898233",
"email": "joao.silva@example.com"
}
}
],
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
Assinaturas
Listar Assinaturas
Recupera uma lista paginada de todas as assinaturas ativas.
GET
/
subscriptions
Listar Assinaturas
curl --request GET \
--url https://api.example.com/subscriptions \
--header 'x-api-key: <x-api-key>'import requests
url = "https://api.example.com/subscriptions"
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.example.com/subscriptions', 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.example.com/subscriptions",
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.example.com/subscriptions"
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.example.com/subscriptions")
.header("x-api-key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/subscriptions")
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{
"data": [
{
"partner_id": "pa_10000",
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10000",
"beneficiary": {
"name": "João Silva",
"cpf": "34567898233",
"email": "joao.silva@example.com"
}
}
],
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
Visão Geral
Este endpoint retorna todas as assinaturas ativas do parceiro, com suporte a paginação para facilitar a navegação em grandes volumes de dados.Autenticação
string
required
Sua chave de API fornecida pela Zentek.
Query Parameters
number
default:"1"
Número da página a ser exibida.
number
default:"10"
Número de itens por página (máximo: 100).
Exemplo de Request
curl -X GET "https://api.partner.zentek.com.br/v1/subscriptions?page=1&page_size=10" \
-H "x-api-key: SUA_API_KEY" \
-H "Accept: application/json"
const response = await fetch('https://api.partner.zentek.com.br/v1/subscriptions?page=1&page_size=10', {
headers: {
'x-api-key': 'SUA_API_KEY',
'Accept': 'application/json'
}
});
Response
array
object
{
"data": [
{
"partner_id": "pa_10000",
"start_date": "2023-02-22T06:16:49.584Z",
"expiry_date": "2024-02-22T06:16:49.584Z",
"plan_id": "plan_10000",
"beneficiary": {
"name": "João Silva",
"cpf": "34567898233",
"email": "joao.silva@example.com"
}
}
],
"pagination": {
"page": 1,
"page_size": 10,
"total_items": 1,
"total_pages": 1,
"has_next": false,
"has_previous": false
}
}
Was this page helpful?
⌘I
