Enviar URL de e-book para produto
curl --request POST \
--url https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url \
--header 'Content-Type: application/json' \
--header 'X-Api-Client-Token: <api-key>' \
--data '
{
"url": "https://files.minha-plataforma.com/ebooks/guia.pdf",
"name": "Guia Definitivo de Marketing"
}
'import requests
url = "https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url"
payload = {
"url": "https://files.minha-plataforma.com/ebooks/guia.pdf",
"name": "Guia Definitivo de Marketing"
}
headers = {
"X-Api-Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://files.minha-plataforma.com/ebooks/guia.pdf',
name: 'Guia Definitivo de Marketing'
})
};
fetch('https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url', 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://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://files.minha-plataforma.com/ebooks/guia.pdf',
'name' => 'Guia Definitivo de Marketing'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Client-Token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url"
payload := strings.NewReader("{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url")
.header("X-Api-Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Produtos
Enviar URL de e-book para produto
Associa um e-book externo a um produto do tipo e-book por meio de uma URL hospedada no domínio de arquivos do cliente.
Regras:
- O produto deve ser do tipo “ebook”.
- A URL deve pertencer ao domínio configurado em
files_domainnas configurações do cliente.
POST
/
products
/
{product_hash}
/
ebook-url
Enviar URL de e-book para produto
curl --request POST \
--url https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url \
--header 'Content-Type: application/json' \
--header 'X-Api-Client-Token: <api-key>' \
--data '
{
"url": "https://files.minha-plataforma.com/ebooks/guia.pdf",
"name": "Guia Definitivo de Marketing"
}
'import requests
url = "https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url"
payload = {
"url": "https://files.minha-plataforma.com/ebooks/guia.pdf",
"name": "Guia Definitivo de Marketing"
}
headers = {
"X-Api-Client-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Client-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://files.minha-plataforma.com/ebooks/guia.pdf',
name: 'Guia Definitivo de Marketing'
})
};
fetch('https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url', 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://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://files.minha-plataforma.com/ebooks/guia.pdf',
'name' => 'Guia Definitivo de Marketing'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Client-Token: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url"
payload := strings.NewReader("{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Client-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url")
.header("X-Api-Client-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://nexus.ticto.com.br/api/v1/products/{product_hash}/ebook-url")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Api-Client-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://files.minha-plataforma.com/ebooks/guia.pdf\",\n \"name\": \"Guia Definitivo de Marketing\"\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"url": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}Authorizations
ApiClientTokenbearerAuth
Token de autenticação do cliente obtido via endpoint /auth
Path Parameters
Hash do produto
Body
application/json
URL absoluta do arquivo do e-book (deve pertencer ao domínio configurado em files_domain)
Example:
"https://files.minha-plataforma.com/ebooks/guia.pdf"
Nome do e-book a ser exibido
Maximum string length:
191Example:
"Guia Definitivo de Marketing"
Tipo do arquivo do e-book
Available options:
pdf, epub