Meta
Concluir Embedded Signup (Meta)
Conclui um Embedded Signup hospedado: o token (gerado por POST /api/v1/numbers/remote-pairing { provider: META }) carrega o tenant, então o fluxo no browser não precisa de key ps_. Chamado pela página /connect/<token> depois que o Facebook retorna o phoneNumberId/wabaId/code escolhidos. Efeito real: cria o número Meta. 401 INVALID_SESSION se o token expirar.
POST
/
v1
/
meta-embedded
/
{token}
/
complete
Concluir Embedded Signup (Meta)
curl --request POST \
--url https://pilotstatus.com.br/v1/meta-embedded/{token}/complete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"code": "AQB...",
"phoneNumberId": "123456789012345",
"wabaId": "987654321098765"
}
'import requests
url = "https://pilotstatus.com.br/v1/meta-embedded/{token}/complete"
payload = {
"code": "AQB...",
"phoneNumberId": "123456789012345",
"wabaId": "987654321098765"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'AQB...', phoneNumberId: '123456789012345', wabaId: '987654321098765'})
};
fetch('https://pilotstatus.com.br/v1/meta-embedded/{token}/complete', 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://pilotstatus.com.br/v1/meta-embedded/{token}/complete",
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([
'code' => 'AQB...',
'phoneNumberId' => '123456789012345',
'wabaId' => '987654321098765'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/meta-embedded/{token}/complete"
payload := strings.NewReader("{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/meta-embedded/{token}/complete")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/meta-embedded/{token}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}"
response = http.request(request)
puts response.read_body{
"number": {
"id": "num_01HZX...",
"number": "5511999999999",
"provider": "META",
"isFullyConnected": true
},
"redirectUrl": "https://app.acme.com/done"
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}Autorizações
apiKeyapiKeyId
Sua chave de API ps_
Parâmetros de caminho
Token de sessão do Embedded Signup.
Corpo
application/json
Resposta
Concluir signup
Esta página foi útil?
⌘I
Concluir Embedded Signup (Meta)
curl --request POST \
--url https://pilotstatus.com.br/v1/meta-embedded/{token}/complete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"code": "AQB...",
"phoneNumberId": "123456789012345",
"wabaId": "987654321098765"
}
'import requests
url = "https://pilotstatus.com.br/v1/meta-embedded/{token}/complete"
payload = {
"code": "AQB...",
"phoneNumberId": "123456789012345",
"wabaId": "987654321098765"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'AQB...', phoneNumberId: '123456789012345', wabaId: '987654321098765'})
};
fetch('https://pilotstatus.com.br/v1/meta-embedded/{token}/complete', 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://pilotstatus.com.br/v1/meta-embedded/{token}/complete",
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([
'code' => 'AQB...',
'phoneNumberId' => '123456789012345',
'wabaId' => '987654321098765'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pilotstatus.com.br/v1/meta-embedded/{token}/complete"
payload := strings.NewReader("{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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://pilotstatus.com.br/v1/meta-embedded/{token}/complete")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pilotstatus.com.br/v1/meta-embedded/{token}/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"AQB...\",\n \"phoneNumberId\": \"123456789012345\",\n \"wabaId\": \"987654321098765\"\n}"
response = http.request(request)
puts response.read_body{
"number": {
"id": "num_01HZX...",
"number": "5511999999999",
"provider": "META",
"isFullyConnected": true
},
"redirectUrl": "https://app.acme.com/done"
}{
"error": "Validation error"
}{
"error": "Unauthorized"
}{
"error": "Too many requests"
}