Subscribe this browser for account push
curl --request POST \
--url https://api.qbank.cl/platform/v1/me/push/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "https://fcm.googleapis.com/fcm/send/subscription-id",
"keys": {
"p256dh": "BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop",
"auth": "16bytesOfAuthKey12"
},
"locale": "es"
}
'import requests
url = "https://api.qbank.cl/platform/v1/me/push/subscriptions"
payload = {
"endpoint": "https://fcm.googleapis.com/fcm/send/subscription-id",
"keys": {
"p256dh": "BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop",
"auth": "16bytesOfAuthKey12"
},
"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({
endpoint: 'https://fcm.googleapis.com/fcm/send/subscription-id',
keys: {
p256dh: 'BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop',
auth: '16bytesOfAuthKey12'
},
locale: 'es'
})
};
fetch('https://api.qbank.cl/platform/v1/me/push/subscriptions', 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/subscriptions",
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([
'endpoint' => 'https://fcm.googleapis.com/fcm/send/subscription-id',
'keys' => [
'p256dh' => 'BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop',
'auth' => '16bytesOfAuthKey12'
],
'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/subscriptions"
payload := strings.NewReader("{\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\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/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/push/subscriptions")
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 \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\n \"locale\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "7a3f2b1c-0000-4000-8000-000000000001",
"endpoint_host": "fcm.googleapis.com",
"subscribed": true
}{
"error": "invalid_subscription",
"message": "endpoint must be an https URL"
}{
"error": "account_blocked",
"message": "account is not active"
}{
"error": "push_unavailable",
"message": "web push is not configured in this environment"
}Subscribe this browser for account push
Registers or refreshes a WebPush subscription for the calling account (active accounts only). The account then receives review transitions (info requested, released, rejected) with a deep-link and no PII. 503 push_unavailable when push is not configured; 400 invalid_subscription when the endpoint/keys contract fails.
POST
/
v1
/
me
/
push
/
subscriptions
Subscribe this browser for account push
curl --request POST \
--url https://api.qbank.cl/platform/v1/me/push/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"endpoint": "https://fcm.googleapis.com/fcm/send/subscription-id",
"keys": {
"p256dh": "BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop",
"auth": "16bytesOfAuthKey12"
},
"locale": "es"
}
'import requests
url = "https://api.qbank.cl/platform/v1/me/push/subscriptions"
payload = {
"endpoint": "https://fcm.googleapis.com/fcm/send/subscription-id",
"keys": {
"p256dh": "BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop",
"auth": "16bytesOfAuthKey12"
},
"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({
endpoint: 'https://fcm.googleapis.com/fcm/send/subscription-id',
keys: {
p256dh: 'BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop',
auth: '16bytesOfAuthKey12'
},
locale: 'es'
})
};
fetch('https://api.qbank.cl/platform/v1/me/push/subscriptions', 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/subscriptions",
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([
'endpoint' => 'https://fcm.googleapis.com/fcm/send/subscription-id',
'keys' => [
'p256dh' => 'BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop',
'auth' => '16bytesOfAuthKey12'
],
'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/subscriptions"
payload := strings.NewReader("{\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\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/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\n \"locale\": \"es\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.qbank.cl/platform/v1/me/push/subscriptions")
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 \"endpoint\": \"https://fcm.googleapis.com/fcm/send/subscription-id\",\n \"keys\": {\n \"p256dh\": \"BFHxY9zQwErTyUiOpAsDfGhJkLzXcVbNm1234567890abcdefghijklmnop\",\n \"auth\": \"16bytesOfAuthKey12\"\n },\n \"locale\": \"es\"\n}"
response = http.request(request)
puts response.read_body{
"id": "7a3f2b1c-0000-4000-8000-000000000001",
"endpoint_host": "fcm.googleapis.com",
"subscribed": true
}{
"error": "invalid_subscription",
"message": "endpoint must be an https URL"
}{
"error": "account_blocked",
"message": "account is not active"
}{
"error": "push_unavailable",
"message": "web push is not configured in this environment"
}Authorizations
Body
application/json
Response
Subscription saved (masked view + subscribed flag).