Criar OAuth app
curl --request POST \
--url https://api.notifique.dev/v1/oauth/apps \
--header 'Content-Type: application/json' \
--data '
{
"name": "Meu SaaS",
"redirectUris": [
"https://meuapp.com/oauth/callback"
],
"allowedScopes": [
"email:send",
"contacts:read"
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Meu SaaS',
redirectUris: ['https://meuapp.com/oauth/callback'],
allowedScopes: ['email:send', 'contacts:read']
})
};
fetch('https://api.notifique.dev/v1/oauth/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/oauth/apps"
payload = {
"name": "Meu SaaS",
"redirectUris": ["https://meuapp.com/oauth/callback"],
"allowedScopes": ["email:send", "contacts:read"]
}
headers = {"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/oauth/apps"
payload := strings.NewReader("{\n \"name\": \"Meu SaaS\",\n \"redirectUris\": [\n \"https://meuapp.com/oauth/callback\"\n ],\n \"allowedScopes\": [\n \"email:send\",\n \"contacts:read\"\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"success": true,
"data": {
"id": "cloauthapp_01HNEW...",
"name": "Meu SaaS",
"clientId": "ntf_oauth_cl_abc123",
"clientSecret": "ntf_oauth_cs_shown_once_xyz...",
"redirectUris": [
"https://meuapp.com/oauth/callback"
],
"scopes": [
"email:send",
"contacts:read"
]
}
}OAuth
Criar OAuth app
Cria app OAuth do workspace. clientSecret retornado uma vez. Escopo oauth_apps:manage.
POST
/
v1
/
oauth
/
apps
Criar OAuth app
curl --request POST \
--url https://api.notifique.dev/v1/oauth/apps \
--header 'Content-Type: application/json' \
--data '
{
"name": "Meu SaaS",
"redirectUris": [
"https://meuapp.com/oauth/callback"
],
"allowedScopes": [
"email:send",
"contacts:read"
]
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Meu SaaS',
redirectUris: ['https://meuapp.com/oauth/callback'],
allowedScopes: ['email:send', 'contacts:read']
})
};
fetch('https://api.notifique.dev/v1/oauth/apps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.notifique.dev/v1/oauth/apps"
payload = {
"name": "Meu SaaS",
"redirectUris": ["https://meuapp.com/oauth/callback"],
"allowedScopes": ["email:send", "contacts:read"]
}
headers = {"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/oauth/apps"
payload := strings.NewReader("{\n \"name\": \"Meu SaaS\",\n \"redirectUris\": [\n \"https://meuapp.com/oauth/callback\"\n ],\n \"allowedScopes\": [\n \"email:send\",\n \"contacts:read\"\n ]\n}")
req, _ := http.NewRequest("POST", 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))
}{
"success": true,
"data": {
"id": "cloauthapp_01HNEW...",
"name": "Meu SaaS",
"clientId": "ntf_oauth_cl_abc123",
"clientSecret": "ntf_oauth_cs_shown_once_xyz...",
"redirectUris": [
"https://meuapp.com/oauth/callback"
],
"scopes": [
"email:send",
"contacts:read"
]
}
}Esta página foi útil?

