Sustituir el catálogo de acciones
curl --request PUT \
--url https://api.coupons.piixan.ai/v1/catalogo-acciones \
--header 'Content-Type: application/json' \
--data '
{
"acciones": [
{
"cupon_tipo_id": "<string>",
"id": 2,
"nombre": "<string>",
"canal": "push",
"categoria": "<string>",
"coste_envio_mxn": 0,
"descuento_pct": 0
}
]
}
'import requests
url = "https://api.coupons.piixan.ai/v1/catalogo-acciones"
payload = { "acciones": [
{
"cupon_tipo_id": "<string>",
"id": 2,
"nombre": "<string>",
"canal": "push",
"categoria": "<string>",
"coste_envio_mxn": 0,
"descuento_pct": 0
}
] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
acciones: [
{
cupon_tipo_id: '<string>',
id: 2,
nombre: '<string>',
canal: 'push',
categoria: '<string>',
coste_envio_mxn: 0,
descuento_pct: 0
}
]
})
};
fetch('https://api.coupons.piixan.ai/v1/catalogo-acciones', 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.coupons.piixan.ai/v1/catalogo-acciones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'acciones' => [
[
'cupon_tipo_id' => '<string>',
'id' => 2,
'nombre' => '<string>',
'canal' => 'push',
'categoria' => '<string>',
'coste_envio_mxn' => 0,
'descuento_pct' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.coupons.piixan.ai/v1/catalogo-acciones"
payload := strings.NewReader("{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.coupons.piixan.ai/v1/catalogo-acciones")
.header("Content-Type", "application/json")
.body("{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coupons.piixan.ai/v1/catalogo-acciones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"codigo": "no_autenticado",
"mensaje": "token inválido o caducado"
}{
"codigo": "sin_permiso",
"mensaje": "la credencial no tiene el ámbito decisiones:pedir"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"codigo": "limite_excedido",
"mensaje": "límite de ritmo superado"
}decisiones
Sustituir el catálogo de acciones
El menú de cupones con su coste y descuento (§9.1). Una acción nueva empieza sin soporte: recibe exploración dirigida hasta tenerlo (§10.4).
PUT
/
v1
/
catalogo-acciones
Sustituir el catálogo de acciones
curl --request PUT \
--url https://api.coupons.piixan.ai/v1/catalogo-acciones \
--header 'Content-Type: application/json' \
--data '
{
"acciones": [
{
"cupon_tipo_id": "<string>",
"id": 2,
"nombre": "<string>",
"canal": "push",
"categoria": "<string>",
"coste_envio_mxn": 0,
"descuento_pct": 0
}
]
}
'import requests
url = "https://api.coupons.piixan.ai/v1/catalogo-acciones"
payload = { "acciones": [
{
"cupon_tipo_id": "<string>",
"id": 2,
"nombre": "<string>",
"canal": "push",
"categoria": "<string>",
"coste_envio_mxn": 0,
"descuento_pct": 0
}
] }
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
acciones: [
{
cupon_tipo_id: '<string>',
id: 2,
nombre: '<string>',
canal: 'push',
categoria: '<string>',
coste_envio_mxn: 0,
descuento_pct: 0
}
]
})
};
fetch('https://api.coupons.piixan.ai/v1/catalogo-acciones', 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.coupons.piixan.ai/v1/catalogo-acciones",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'acciones' => [
[
'cupon_tipo_id' => '<string>',
'id' => 2,
'nombre' => '<string>',
'canal' => 'push',
'categoria' => '<string>',
'coste_envio_mxn' => 0,
'descuento_pct' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.coupons.piixan.ai/v1/catalogo-acciones"
payload := strings.NewReader("{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.coupons.piixan.ai/v1/catalogo-acciones")
.header("Content-Type", "application/json")
.body("{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coupons.piixan.ai/v1/catalogo-acciones")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"acciones\": [\n {\n \"cupon_tipo_id\": \"<string>\",\n \"id\": 2,\n \"nombre\": \"<string>\",\n \"canal\": \"push\",\n \"categoria\": \"<string>\",\n \"coste_envio_mxn\": 0,\n \"descuento_pct\": 0\n }\n ]\n}"
response = http.request(request)
puts response.read_body{}{
"codigo": "no_autenticado",
"mensaje": "token inválido o caducado"
}{
"codigo": "sin_permiso",
"mensaje": "la credencial no tiene el ámbito decisiones:pedir"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}{
"codigo": "limite_excedido",
"mensaje": "límite de ritmo superado"
}Body
application/json
Cuerpo de PUT /v1/catalogo-acciones. Sustituye el catálogo completo.
Required array length:
1 - 20 elementsShow child attributes
Show child attributes
Response
Successful Response
The response is of type Response Catalogo V1 Catalogo Acciones Put · object.