Create contact
curl --request POST \
--url https://connect.pingback.com/v2/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "example@email.com",
"origin": {
"url": "https://pingback.com",
"utmSource": "source"
},
"attributes": {
"name": "John Doe",
"phone": "+5531999999999"
}
}
'import requests
url = "https://connect.pingback.com/v2/contacts"
payload = {
"email": "example@email.com",
"origin": {
"url": "https://pingback.com",
"utmSource": "source"
},
"attributes": {
"name": "John Doe",
"phone": "+5531999999999"
}
}
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({
email: 'example@email.com',
origin: {url: 'https://pingback.com', utmSource: 'source'},
attributes: {name: 'John Doe', phone: '+5531999999999'}
})
};
fetch('https://connect.pingback.com/v2/contacts', 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://connect.pingback.com/v2/contacts",
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([
'email' => 'example@email.com',
'origin' => [
'url' => 'https://pingback.com',
'utmSource' => 'source'
],
'attributes' => [
'name' => 'John Doe',
'phone' => '+5531999999999'
]
]),
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://connect.pingback.com/v2/contacts"
payload := strings.NewReader("{\n \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\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://connect.pingback.com/v2/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.pingback.com/v2/contacts")
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 \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Contact created",
"data": {
"id": "ea8a2a47-2a05-4a43-b284-35df0ea46333",
"email": "example@email.com"
}
}{
"error": "Body is necessary.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "MISSING_BODY"
}{
"error": "User is not authorized to access this resource with an explicit deny in an identity-based policy.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "FORBIDDEN"
}{
"error": "Contact already exists",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "CONTACT_ALREADY_EXISTS"
}{
"error": "Invalid JSON body",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INVALID_INPUT"
}{
"error": "An unexpected error occurred.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INTERNAL_SERVER_ERROR"
}Contatos
Criar Contato
Cria um novo contato.
POST
/
contacts
Create contact
curl --request POST \
--url https://connect.pingback.com/v2/contacts \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"email": "example@email.com",
"origin": {
"url": "https://pingback.com",
"utmSource": "source"
},
"attributes": {
"name": "John Doe",
"phone": "+5531999999999"
}
}
'import requests
url = "https://connect.pingback.com/v2/contacts"
payload = {
"email": "example@email.com",
"origin": {
"url": "https://pingback.com",
"utmSource": "source"
},
"attributes": {
"name": "John Doe",
"phone": "+5531999999999"
}
}
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({
email: 'example@email.com',
origin: {url: 'https://pingback.com', utmSource: 'source'},
attributes: {name: 'John Doe', phone: '+5531999999999'}
})
};
fetch('https://connect.pingback.com/v2/contacts', 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://connect.pingback.com/v2/contacts",
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([
'email' => 'example@email.com',
'origin' => [
'url' => 'https://pingback.com',
'utmSource' => 'source'
],
'attributes' => [
'name' => 'John Doe',
'phone' => '+5531999999999'
]
]),
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://connect.pingback.com/v2/contacts"
payload := strings.NewReader("{\n \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\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://connect.pingback.com/v2/contacts")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://connect.pingback.com/v2/contacts")
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 \"email\": \"example@email.com\",\n \"origin\": {\n \"url\": \"https://pingback.com\",\n \"utmSource\": \"source\"\n },\n \"attributes\": {\n \"name\": \"John Doe\",\n \"phone\": \"+5531999999999\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "Contact created",
"data": {
"id": "ea8a2a47-2a05-4a43-b284-35df0ea46333",
"email": "example@email.com"
}
}{
"error": "Body is necessary.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "MISSING_BODY"
}{
"error": "User is not authorized to access this resource with an explicit deny in an identity-based policy.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "FORBIDDEN"
}{
"error": "Contact already exists",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "CONTACT_ALREADY_EXISTS"
}{
"error": "Invalid JSON body",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INVALID_INPUT"
}{
"error": "An unexpected error occurred.",
"requestId": "6795d530-07c4-43b6-8b85-dfc2cfceceb5",
"errorCode": "INTERNAL_SERVER_ERROR"
}Esta página foi útil?
⌘I