Get Website Keys
curl --request GET \
--url https://api.aimtell.com/prod/site/{id}/keys \
--header 'X-Authorization-Api-Key: <api-key>'import requests
url = "https://api.aimtell.com/prod/site/{id}/keys"
headers = {"X-Authorization-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Authorization-Api-Key': '<api-key>'}};
fetch('https://api.aimtell.com/prod/site/{id}/keys', 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.aimtell.com/prod/site/{id}/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Authorization-Api-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.aimtell.com/prod/site/{id}/keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Authorization-Api-Key", "<api-key>")
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.aimtell.com/prod/site/{id}/keys")
.header("X-Authorization-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aimtell.com/prod/site/{id}/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Authorization-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 4158,
"id_site": 2459,
"type": "vapid",
"pub": "BM2J8-VPPGUINMc5ZE5H-ewuE8ryMM3-h4GE4IHtKQap_PPJERb0T-_fppoDnOmyEdLU1Nb7xzcKFi5x9jEOMnI",
"priv": "RM3m2AzedWxZzyYU0_ltzJFBJAxGalHZ_FAKEPRIVATEKEY",
"is_primary": 1,
"active": 1,
"created_at": "2019-12-11 06:10:54",
"updated_at": "2019-12-11 06:10:54"
},
{
"id": 4086,
"id_site": 2459,
"type": "vapid",
"pub": "BAYZiAyn2A7NYI606S9UVzHSzhXzUXYmTZE6Ii38c0qFfBofhUW3zwp05HYjBXpkXNIIGoNnXb3zC234wEc67Zs",
"priv": "r_4nBwszaQ_1HfCorhudu33Z7vm_FAKEPRIVATEKEY",
"is_primary": 0,
"active": 1,
"created_at": "2019-12-07 00:00:18",
"updated_at": "2019-12-11 06:10:54"
},
{
"id": 2,
"id_site": 2459,
"type": "gcm",
"pub": "315084543558",
"priv": "AAAASVyAlkY:APA91bGV2fr7-VHf-r3U9U-45i_Tkr5UyKha9k18w6-MM9NO3rc_HwFbEUmGJY_4TNyimvr6-ooveEMy8rder0VZ2beBgJSXW2SF7dcHijTeVxohbi8X8-f58cZdN0C2Ig7AZ65ePMxVWF-uvGBcxyuw_FAKEPRIVATEKEY",
"is_primary": 0,
"active": 1,
"created_at": "2019-04-24 19:44:55",
"updated_at": "2019-05-15 02:17:00"
}
]{
"result": "error",
"message": "Error #136."
}{
"result": "error",
"message": "Please specify a valid auth_token."
}Settings
Get Website Keys
Gets a Website’s VAPID or FCM Keys
Keys that are marked “is_primary” are the ones that will be currently used on the site for new subscribers.
If the results are empty, this means you are using legacy Aimtell keys. We advise you to generate your own VAPID keys within the dashboard.
GET
/
prod
/
site
/
{id}
/
keys
Get Website Keys
curl --request GET \
--url https://api.aimtell.com/prod/site/{id}/keys \
--header 'X-Authorization-Api-Key: <api-key>'import requests
url = "https://api.aimtell.com/prod/site/{id}/keys"
headers = {"X-Authorization-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Authorization-Api-Key': '<api-key>'}};
fetch('https://api.aimtell.com/prod/site/{id}/keys', 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.aimtell.com/prod/site/{id}/keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Authorization-Api-Key: <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"
"net/http"
"io"
)
func main() {
url := "https://api.aimtell.com/prod/site/{id}/keys"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Authorization-Api-Key", "<api-key>")
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.aimtell.com/prod/site/{id}/keys")
.header("X-Authorization-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aimtell.com/prod/site/{id}/keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Authorization-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"id": 4158,
"id_site": 2459,
"type": "vapid",
"pub": "BM2J8-VPPGUINMc5ZE5H-ewuE8ryMM3-h4GE4IHtKQap_PPJERb0T-_fppoDnOmyEdLU1Nb7xzcKFi5x9jEOMnI",
"priv": "RM3m2AzedWxZzyYU0_ltzJFBJAxGalHZ_FAKEPRIVATEKEY",
"is_primary": 1,
"active": 1,
"created_at": "2019-12-11 06:10:54",
"updated_at": "2019-12-11 06:10:54"
},
{
"id": 4086,
"id_site": 2459,
"type": "vapid",
"pub": "BAYZiAyn2A7NYI606S9UVzHSzhXzUXYmTZE6Ii38c0qFfBofhUW3zwp05HYjBXpkXNIIGoNnXb3zC234wEc67Zs",
"priv": "r_4nBwszaQ_1HfCorhudu33Z7vm_FAKEPRIVATEKEY",
"is_primary": 0,
"active": 1,
"created_at": "2019-12-07 00:00:18",
"updated_at": "2019-12-11 06:10:54"
},
{
"id": 2,
"id_site": 2459,
"type": "gcm",
"pub": "315084543558",
"priv": "AAAASVyAlkY:APA91bGV2fr7-VHf-r3U9U-45i_Tkr5UyKha9k18w6-MM9NO3rc_HwFbEUmGJY_4TNyimvr6-ooveEMy8rder0VZ2beBgJSXW2SF7dcHijTeVxohbi8X8-f58cZdN0C2Ig7AZ65ePMxVWF-uvGBcxyuw_FAKEPRIVATEKEY",
"is_primary": 0,
"active": 1,
"created_at": "2019-04-24 19:44:55",
"updated_at": "2019-05-15 02:17:00"
}
]{
"result": "error",
"message": "Error #136."
}{
"result": "error",
"message": "Please specify a valid auth_token."
}⌘I

