cURL
curl --request POST \
--url https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rawText": "Seu codigo de verificação e 123456",
"originPhoneNumber": "23456"
}
'import requests
url = "https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms"
payload = {
"rawText": "Seu codigo de verificação e 123456",
"originPhoneNumber": "23456"
}
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({rawText: 'Seu codigo de verificação e 123456', originPhoneNumber: '23456'})
};
fetch('https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms', 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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms",
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([
'rawText' => 'Seu codigo de verificação e 123456',
'originPhoneNumber' => '23456'
]),
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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms"
payload := strings.NewReader("{\n \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms")
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 \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\n}"
response = http.request(request)
puts response.read_body{
"code": "unauthorized",
"message": "<string>",
"publicDetails": {}
}{
"code": "forbidden",
"message": "<string>",
"publicDetails": {}
}{
"code": "resource-not-found",
"message": "<string>",
"publicDetails": {}
}{
"code": "payload-too-large",
"message": "<string>",
"publicDetails": {}
}{
"message": "<string>",
"publicDetails": {}
}{
"code": "unknown",
"message": "<string>",
"publicDetails": {}
}Números virtuais
Simular recebimento de SMS
Simula o recebimento de um SMS em uma linha virtual. Disponível apenas no ambiente sandbox.
POST
/
api
/
v2
/
virtual-phone-accounts
/
{id}
/
sms
cURL
curl --request POST \
--url https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"rawText": "Seu codigo de verificação e 123456",
"originPhoneNumber": "23456"
}
'import requests
url = "https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms"
payload = {
"rawText": "Seu codigo de verificação e 123456",
"originPhoneNumber": "23456"
}
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({rawText: 'Seu codigo de verificação e 123456', originPhoneNumber: '23456'})
};
fetch('https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms', 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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms",
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([
'rawText' => 'Seu codigo de verificação e 123456',
'originPhoneNumber' => '23456'
]),
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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms"
payload := strings.NewReader("{\n \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\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.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salvy.com.br/api/v2/virtual-phone-accounts/{id}/sms")
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 \"rawText\": \"Seu codigo de verificação e 123456\",\n \"originPhoneNumber\": \"23456\"\n}"
response = http.request(request)
puts response.read_body{
"code": "unauthorized",
"message": "<string>",
"publicDetails": {}
}{
"code": "forbidden",
"message": "<string>",
"publicDetails": {}
}{
"code": "resource-not-found",
"message": "<string>",
"publicDetails": {}
}{
"code": "payload-too-large",
"message": "<string>",
"publicDetails": {}
}{
"message": "<string>",
"publicDetails": {}
}{
"code": "unknown",
"message": "<string>",
"publicDetails": {}
}Para utilizar nossas APIs e Webhooks de linhas virtuais, é necessário aderir ao nosso manual de branding
rawText com o conteúdo da mensagem e originPhoneNumber com o número de origem.
Use este endpoint para gerar um evento de SMS recebido e validar o seu
webhook.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
application/json
Conteúdo da mensagem SMS simulada, até 160 caracteres.
Maximum string length:
160Pattern:
^[\x20-\x7EÀ-ÿ]*$Example:
"Seu codigo de verificação e 123456"
Número de origem do SMS simulado (short code A2P ou alfanumérico).
Required string length:
1 - 15Pattern:
^[A-Za-z0-9]+$Example:
"23456"
Response
⌘I