Enviar notificación
curl --request POST \
--url https://community.goil.app/api/v1/external/notification/send \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"title": "<string>",
"body": "<string>",
"url": "<string>",
"sendWhatsApp": true
},
"phones": [
"<string>"
],
"accountIDs": [
"<string>"
],
"accountTypeIDs": [
"<string>"
],
"hiddenFromList": false,
"senderAccountId": "<string>",
"metadata": {
"sectionId": "<string>"
}
}
'import requests
url = "https://community.goil.app/api/v1/external/notification/send"
payload = {
"message": {
"title": "<string>",
"body": "<string>",
"url": "<string>",
"sendWhatsApp": True
},
"phones": ["<string>"],
"accountIDs": ["<string>"],
"accountTypeIDs": ["<string>"],
"hiddenFromList": False,
"senderAccountId": "<string>",
"metadata": { "sectionId": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
title: '<string>',
body: JSON.stringify('<string>'),
url: '<string>',
sendWhatsApp: true
},
phones: ['<string>'],
accountIDs: ['<string>'],
accountTypeIDs: ['<string>'],
hiddenFromList: false,
senderAccountId: '<string>',
metadata: {sectionId: '<string>'}
})
};
fetch('https://community.goil.app/api/v1/external/notification/send', 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://community.goil.app/api/v1/external/notification/send",
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([
'message' => [
'title' => '<string>',
'body' => '<string>',
'url' => '<string>',
'sendWhatsApp' => true
],
'phones' => [
'<string>'
],
'accountIDs' => [
'<string>'
],
'accountTypeIDs' => [
'<string>'
],
'hiddenFromList' => false,
'senderAccountId' => '<string>',
'metadata' => [
'sectionId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://community.goil.app/api/v1/external/notification/send"
payload := strings.NewReader("{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://community.goil.app/api/v1/external/notification/send")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://community.goil.app/api/v1/external/notification/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"msg": "<string>"
}
}{
"timestamp": 123,
"error": "<string>",
"data": {}
}Notification
Enviar notificación
Envía notificación push (y opcionalmente WhatsApp). Requiere x-client-id.
Exactamente uno de phones, accountIDs o accountTypeIDs debe estar presente.
POST
/
notification
/
send
Enviar notificación
curl --request POST \
--url https://community.goil.app/api/v1/external/notification/send \
--header 'Content-Type: application/json' \
--data '
{
"message": {
"title": "<string>",
"body": "<string>",
"url": "<string>",
"sendWhatsApp": true
},
"phones": [
"<string>"
],
"accountIDs": [
"<string>"
],
"accountTypeIDs": [
"<string>"
],
"hiddenFromList": false,
"senderAccountId": "<string>",
"metadata": {
"sectionId": "<string>"
}
}
'import requests
url = "https://community.goil.app/api/v1/external/notification/send"
payload = {
"message": {
"title": "<string>",
"body": "<string>",
"url": "<string>",
"sendWhatsApp": True
},
"phones": ["<string>"],
"accountIDs": ["<string>"],
"accountTypeIDs": ["<string>"],
"hiddenFromList": False,
"senderAccountId": "<string>",
"metadata": { "sectionId": "<string>" }
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
message: {
title: '<string>',
body: JSON.stringify('<string>'),
url: '<string>',
sendWhatsApp: true
},
phones: ['<string>'],
accountIDs: ['<string>'],
accountTypeIDs: ['<string>'],
hiddenFromList: false,
senderAccountId: '<string>',
metadata: {sectionId: '<string>'}
})
};
fetch('https://community.goil.app/api/v1/external/notification/send', 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://community.goil.app/api/v1/external/notification/send",
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([
'message' => [
'title' => '<string>',
'body' => '<string>',
'url' => '<string>',
'sendWhatsApp' => true
],
'phones' => [
'<string>'
],
'accountIDs' => [
'<string>'
],
'accountTypeIDs' => [
'<string>'
],
'hiddenFromList' => false,
'senderAccountId' => '<string>',
'metadata' => [
'sectionId' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"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://community.goil.app/api/v1/external/notification/send"
payload := strings.NewReader("{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\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))
}HttpResponse<String> response = Unirest.post("https://community.goil.app/api/v1/external/notification/send")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://community.goil.app/api/v1/external/notification/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": {\n \"title\": \"<string>\",\n \"body\": \"<string>\",\n \"url\": \"<string>\",\n \"sendWhatsApp\": true\n },\n \"phones\": [\n \"<string>\"\n ],\n \"accountIDs\": [\n \"<string>\"\n ],\n \"accountTypeIDs\": [\n \"<string>\"\n ],\n \"hiddenFromList\": false,\n \"senderAccountId\": \"<string>\",\n \"metadata\": {\n \"sectionId\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"msg": "<string>"
}
}{
"timestamp": 123,
"error": "<string>",
"data": {}
}Body
application/json
Exactamente uno de phones, accountIDs o accountTypeIDs debe estar presente
Show child attributes
Show child attributes
Lista de teléfonos (solo uno de phones, accountIDs o accountTypeIDs)
IDs de cuentas
IDs de tipo de cuenta (envío masivo por tipo)
Show child attributes
Show child attributes
Response
OK
Show child attributes
Show child attributes
