Consultar produto
curl --request GET \
--url https://api.nasten.net/v1/products/{productId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nasten.net/v1/products/{productId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/products/{productId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/products/{productId}",
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>"
],
]);
$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.nasten.net/v1/products/{productId}"
req, _ := http.NewRequest("GET", url, nil)
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://api.nasten.net/v1/products/{productId}")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"data": {
"id": "cmprod0000000000000000001",
"companyId": "<string>",
"status": "approved",
"categoryId": 17,
"name": "Curso Completo de Marketing",
"description": "<string>",
"imageUrl": "<string>",
"productType": "digital",
"billingType": "one_time",
"deliveryType": "payment",
"price": 19900,
"precoAPartirDe": false,
"precoPeriodo": "weekly",
"semOfertaAtiva": false,
"currency": "BRL",
"warrantyDays": 7,
"productorName": "<string>",
"supportEmail": "<string>",
"salesPage": "<string>",
"productContentType": "link",
"productContent": "<string>",
"maxInstallments": 123,
"isCombo": true,
"approvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"company": {
"id": "<string>",
"name": "Empresa Exemplo LTDA",
"documentType": "CNPJ",
"document": "12345678000195"
},
"category": {
"id": 17,
"name": "Educacional"
},
"offers": [
{
"id": 5021,
"slug": "k3x9p2qa",
"title": "Oferta Especial",
"price": 19900,
"acceptMethod": [
"pix",
"credit_card",
"boleto",
"apple_pay"
],
"isDefault": true
}
],
"checkoutUrl": "https://app.nasten.com.br/checkout/k3x9p2qa",
"hasSales": true,
"deliverables": [
{
"id": "<string>",
"fileName": "<string>",
"releaseAfterMinutes": 123,
"url": "<string>"
}
],
"telegramProducts": [
{}
],
"discordProducts": [
{}
]
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}Produtos
Consultar produto
Só produtos com status approved podem ser consultados, editados ou removidos pelo id.
GET
/
v1
/
products
/
{productId}
Consultar produto
curl --request GET \
--url https://api.nasten.net/v1/products/{productId} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.nasten.net/v1/products/{productId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.nasten.net/v1/products/{productId}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.nasten.net/v1/products/{productId}",
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>"
],
]);
$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.nasten.net/v1/products/{productId}"
req, _ := http.NewRequest("GET", url, nil)
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://api.nasten.net/v1/products/{productId}")
.header("Authorization", "Bearer <token>")
.asString();{
"success": true,
"data": {
"id": "cmprod0000000000000000001",
"companyId": "<string>",
"status": "approved",
"categoryId": 17,
"name": "Curso Completo de Marketing",
"description": "<string>",
"imageUrl": "<string>",
"productType": "digital",
"billingType": "one_time",
"deliveryType": "payment",
"price": 19900,
"precoAPartirDe": false,
"precoPeriodo": "weekly",
"semOfertaAtiva": false,
"currency": "BRL",
"warrantyDays": 7,
"productorName": "<string>",
"supportEmail": "<string>",
"salesPage": "<string>",
"productContentType": "link",
"productContent": "<string>",
"maxInstallments": 123,
"isCombo": true,
"approvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z",
"company": {
"id": "<string>",
"name": "Empresa Exemplo LTDA",
"documentType": "CNPJ",
"document": "12345678000195"
},
"category": {
"id": 17,
"name": "Educacional"
},
"offers": [
{
"id": 5021,
"slug": "k3x9p2qa",
"title": "Oferta Especial",
"price": 19900,
"acceptMethod": [
"pix",
"credit_card",
"boleto",
"apple_pay"
],
"isDefault": true
}
],
"checkoutUrl": "https://app.nasten.com.br/checkout/k3x9p2qa",
"hasSales": true,
"deliverables": [
{
"id": "<string>",
"fileName": "<string>",
"releaseAfterMinutes": 123,
"url": "<string>"
}
],
"telegramProducts": [
{}
],
"discordProducts": [
{}
]
}
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"errors": [
{
"path": "customer.document",
"message": "Documento inválido"
}
]
}{
"success": false,
"message": "Token inválido ou expirado",
"code": "NST-401-rcp9"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a"
}{
"success": false,
"message": "Descrição do erro",
"code": "NST-400-3f7a",
"error": "Too Many Requests",
"retryAfterMs": 42000,
"limit": 1800,
"window": "1 minute"
}{
"success": false,
"message": "Internal server error",
"code": "NST-500-9e2b"
}
