cURL
curl --request GET \
--url https://public-api.kiwify.com/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'x-kiwify-account-id: <api-key>'import requests
url = "https://public-api.kiwify.com/v1/products"
headers = {
"x-kiwify-account-id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-kiwify-account-id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://public-api.kiwify.com/v1/products', 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://public-api.kiwify.com/v1/products",
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>",
"x-kiwify-account-id: <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://public-api.kiwify.com/v1/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-kiwify-account-id", "<api-key>")
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://public-api.kiwify.com/v1/products")
.header("x-kiwify-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.kiwify.com/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-kiwify-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pagination": {
"count": 10,
"page_number": 1,
"page_size": 10
},
"data": [
{
"id": "1286a0c0-d492-11ed-9709-c3c5046ec174",
"name": "Produto teste",
"type": "membership",
"created_at": "2023-04-06T15:45:36.013Z",
"currency": "BRL",
"price": null,
"affiliate_enabled": false,
"status": "active",
"payment_type": "recurring"
}
]
}{
"error": "auth_error",
"message": "Invalid token: access token is invalid"
}Produtos
Listar produtos
Obtenha uma lista de todos os produtos.
GET
/
products
cURL
curl --request GET \
--url https://public-api.kiwify.com/v1/products \
--header 'Authorization: Bearer <token>' \
--header 'x-kiwify-account-id: <api-key>'import requests
url = "https://public-api.kiwify.com/v1/products"
headers = {
"x-kiwify-account-id": "<api-key>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-kiwify-account-id': '<api-key>', Authorization: 'Bearer <token>'}
};
fetch('https://public-api.kiwify.com/v1/products', 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://public-api.kiwify.com/v1/products",
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>",
"x-kiwify-account-id: <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://public-api.kiwify.com/v1/products"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-kiwify-account-id", "<api-key>")
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://public-api.kiwify.com/v1/products")
.header("x-kiwify-account-id", "<api-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.kiwify.com/v1/products")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-kiwify-account-id"] = '<api-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"pagination": {
"count": 10,
"page_number": 1,
"page_size": 10
},
"data": [
{
"id": "1286a0c0-d492-11ed-9709-c3c5046ec174",
"name": "Produto teste",
"type": "membership",
"created_at": "2023-04-06T15:45:36.013Z",
"currency": "BRL",
"price": null,
"affiliate_enabled": false,
"status": "active",
"payment_type": "recurring"
}
]
}{
"error": "auth_error",
"message": "Invalid token: access token is invalid"
}Autorizações
The access token received from the authorization server in the OAuth 2.0 flow.
⌘I
