Registrar dispositivo push
curl --request POST \
--url https://api.notifique.dev/v1/push/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appId": "clxx...",
"platform": "web",
"subscription": {
"endpoint": "https://...",
"keys": {
"p256dh": "...",
"auth": "..."
}
},
"externalUserId": "user_123"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 'clxx...',
platform: 'web',
subscription: {endpoint: 'https://...', keys: {p256dh: '...', auth: '...'}},
externalUserId: 'user_123'
})
};
fetch('https://api.notifique.dev/v1/push/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/push/devices"
payload = {
"appId": "clxx...",
"platform": "web",
"subscription": {
"endpoint": "https://...",
"keys": {
"p256dh": "...",
"auth": "..."
}
},
"externalUserId": "user_123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/push/devices"
payload := strings.NewReader("{\n \"appId\": \"clxx...\",\n \"platform\": \"web\",\n \"subscription\": {\n \"endpoint\": \"https://...\",\n \"keys\": {\n \"p256dh\": \"...\",\n \"auth\": \"...\"\n }\n },\n \"externalUserId\": \"user_123\"\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))
}{
"success": true,
"data": {
"id": "<string>",
"appId": "<string>",
"platform": "<string>",
"externalUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}Push Devices
Registrar dispositivo push
Cadastra um celular ou navegador para receber notificações.
POST
/
v1
/
push
/
devices
Registrar dispositivo push
curl --request POST \
--url https://api.notifique.dev/v1/push/devices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"appId": "clxx...",
"platform": "web",
"subscription": {
"endpoint": "https://...",
"keys": {
"p256dh": "...",
"auth": "..."
}
},
"externalUserId": "user_123"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
appId: 'clxx...',
platform: 'web',
subscription: {endpoint: 'https://...', keys: {p256dh: '...', auth: '...'}},
externalUserId: 'user_123'
})
};
fetch('https://api.notifique.dev/v1/push/devices', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/push/devices"
payload = {
"appId": "clxx...",
"platform": "web",
"subscription": {
"endpoint": "https://...",
"keys": {
"p256dh": "...",
"auth": "..."
}
},
"externalUserId": "user_123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.notifique.dev/v1/push/devices"
payload := strings.NewReader("{\n \"appId\": \"clxx...\",\n \"platform\": \"web\",\n \"subscription\": {\n \"endpoint\": \"https://...\",\n \"keys\": {\n \"p256dh\": \"...\",\n \"auth\": \"...\"\n }\n },\n \"externalUserId\": \"user_123\"\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))
}{
"success": true,
"data": {
"id": "<string>",
"appId": "<string>",
"platform": "<string>",
"externalUserId": "<string>",
"createdAt": "2023-11-07T05:31:56Z"
}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}{
"success": false,
"error": "<string>",
"message": "<string>",
"code": "<string>",
"details": {}
}Autorizações
ntfPushBearerAuthntfPushApiKeyHeader
Authorization: Bearer sk_live_xxxxx
Corpo
application/json
Opções disponíveis:
web, android, ios Show child attributes
Show child attributes
FCM token (android) or APNs device token hex (ios)
Required for public android registration; must match PushApp.androidPackageName
Required for public ios registration; must match PushApp.apnsBundleId
CRM contact link, requires authenticated API Key (rejected on public registration)
Esta página foi útil?
⌘I

