Registrar un token push móvil
curl --request POST \
--url https://api.qbank.cl/platform/v1/me/push-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "ios",
"token": "fcm-token-1234567890abcdef",
"device_id": "iphone-17-pro",
"locale": "es"
}
'import requests
url = "https://api.qbank.cl/platform/v1/me/push-tokens"
payload = {
"platform": "ios",
"token": "fcm-token-1234567890abcdef",
"device_id": "iphone-17-pro",
"locale": "es"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
platform: 'ios',
token: 'fcm-token-1234567890abcdef',
device_id: 'iphone-17-pro',
locale: 'es'
})
};
fetch('https://api.qbank.cl/platform/v1/me/push-tokens', 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.qbank.cl/platform/v1/me/push-tokens",
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([
'platform' => 'ios',
'token' => 'fcm-token-1234567890abcdef',
'device_id' => 'iphone-17-pro',
'locale' => 'es'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.qbank.cl/platform/v1/me/push-tokens"
payload := strings.NewReader("{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.qbank.cl/platform/v1/me/push-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/push-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"token_tail": "…90abcdef"
}{
"error": "invalid_push_token",
"message": "platform must be ios or android"
}Registrar un token push móvil
Registra o refresca el token FCM/APNs de un dispositivo móvil de la cuenta. Llamar al iniciar sesión; llamar DELETE al cerrar sesión. Los fallos de validación usan invalid_push_token o invalid_device.
POST
/
v1
/
me
/
push-tokens
Registrar un token push móvil
curl --request POST \
--url https://api.qbank.cl/platform/v1/me/push-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "ios",
"token": "fcm-token-1234567890abcdef",
"device_id": "iphone-17-pro",
"locale": "es"
}
'import requests
url = "https://api.qbank.cl/platform/v1/me/push-tokens"
payload = {
"platform": "ios",
"token": "fcm-token-1234567890abcdef",
"device_id": "iphone-17-pro",
"locale": "es"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
platform: 'ios',
token: 'fcm-token-1234567890abcdef',
device_id: 'iphone-17-pro',
locale: 'es'
})
};
fetch('https://api.qbank.cl/platform/v1/me/push-tokens', 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.qbank.cl/platform/v1/me/push-tokens",
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([
'platform' => 'ios',
'token' => 'fcm-token-1234567890abcdef',
'device_id' => 'iphone-17-pro',
'locale' => 'es'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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.qbank.cl/platform/v1/me/push-tokens"
payload := strings.NewReader("{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.qbank.cl/platform/v1/me/push-tokens")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/push-tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"platform\": \"ios\",\n \"token\": \"fcm-token-1234567890abcdef\",\n \"device_id\": \"iphone-17-pro\",\n \"locale\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "8b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
"token_tail": "…90abcdef"
}{
"error": "invalid_push_token",
"message": "platform must be ios or android"
}Autorizaciones
Cuerpo
application/json
Respuesta
Token push registrado (solo cola, jamás el token completo).