Crear o actualizar contacto
curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cellphone": "+14084029292",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria@acme.com",
"languageCode": "EN",
"ownerIdentifier": {
"identifier": "jane@acme.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"closedAttributes": [],
"openAttributes": []
}
}
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial"
payload = {
"cellphone": "+14084029292",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria@acme.com",
"languageCode": "EN",
"ownerIdentifier": {
"identifier": "jane@acme.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"closedAttributes": [],
"openAttributes": []
}
}
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({
cellphone: '+14084029292',
firstName: 'Maria',
lastName: 'Lopez',
email: 'maria@acme.com',
languageCode: 'EN',
ownerIdentifier: {identifier: 'jane@acme.com', identifierType: 'EMAIL'},
customAttributes: {closedAttributes: [], openAttributes: []}
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial', 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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial",
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([
'cellphone' => '+14084029292',
'firstName' => 'Maria',
'lastName' => 'Lopez',
'email' => 'maria@acme.com',
'languageCode' => 'EN',
'ownerIdentifier' => [
'identifier' => 'jane@acme.com',
'identifierType' => 'EMAIL'
],
'customAttributes' => [
'closedAttributes' => [
],
'openAttributes' => [
]
]
]),
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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial"
payload := strings.NewReader("{\n \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial")
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 \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
}Crear o actualizar contacto
Crea o actualiza un contacto usando solo el celular. Lo clasifica como NORMAL o PARTIAL.
POST
/
bridge
/
api
/
v1
/
workspaces
/
{workspaceId}
/
contacts
/
partial
Crear o actualizar contacto
curl --request POST \
--url https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"cellphone": "+14084029292",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria@acme.com",
"languageCode": "EN",
"ownerIdentifier": {
"identifier": "jane@acme.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"closedAttributes": [],
"openAttributes": []
}
}
'import requests
url = "https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial"
payload = {
"cellphone": "+14084029292",
"firstName": "Maria",
"lastName": "Lopez",
"email": "maria@acme.com",
"languageCode": "EN",
"ownerIdentifier": {
"identifier": "jane@acme.com",
"identifierType": "EMAIL"
},
"customAttributes": {
"closedAttributes": [],
"openAttributes": []
}
}
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({
cellphone: '+14084029292',
firstName: 'Maria',
lastName: 'Lopez',
email: 'maria@acme.com',
languageCode: 'EN',
ownerIdentifier: {identifier: 'jane@acme.com', identifierType: 'EMAIL'},
customAttributes: {closedAttributes: [], openAttributes: []}
})
};
fetch('https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial', 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-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial",
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([
'cellphone' => '+14084029292',
'firstName' => 'Maria',
'lastName' => 'Lopez',
'email' => 'maria@acme.com',
'languageCode' => 'EN',
'ownerIdentifier' => [
'identifier' => 'jane@acme.com',
'identifierType' => 'EMAIL'
],
'customAttributes' => [
'closedAttributes' => [
],
'openAttributes' => [
]
]
]),
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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial"
payload := strings.NewReader("{\n \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\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://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-connect-us.bridge.new/bridge/api/v1/workspaces/{workspaceId}/contacts/partial")
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 \"cellphone\": \"+14084029292\",\n \"firstName\": \"Maria\",\n \"lastName\": \"Lopez\",\n \"email\": \"maria@acme.com\",\n \"languageCode\": \"EN\",\n \"ownerIdentifier\": {\n \"identifier\": \"jane@acme.com\",\n \"identifierType\": \"EMAIL\"\n },\n \"customAttributes\": {\n \"closedAttributes\": [],\n \"openAttributes\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "b6cf1c4a-2b1e-4e63-8f3e-0f9d1a2a1234",
"workspaceId": "92b2d4f3-81e1-4b61-a7ec-6f4ff3b58be5",
"type": "NORMAL",
"createdAt": "2003-04-10T08:00:00.000Z",
"updatedAt": "2003-04-10T08:00:00.000Z",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"cellphone": "+14084029292",
"customAttributes": [
{
"key": "<string>",
"values": [
"<string>"
]
}
],
"languageCode": "EN",
"ownerId": "37673840-6259-40f9-bbe5-a7db40f8e3cf"
}Parámetros de ruta
Cuerpo
application/json
Cuerpo de la solicitud para crear un contacto parcial. Solo cellphone es obligatorio.
Código de idioma del contacto. Obligatorio para la clasificación NORMAL.
Opciones disponibles:
ES, EN, AF, SQ, AR, AZ, BN, BG, CA, ZH_CN, HR, CS, DA, NL, ET, FIL, FI, FR, KA, DE, EL, GU, HA, HE, HI, HU, ID, GA, IT, JA, KN, KK, RW_RW, KO, KY_KG, LO, LV, LT, MK, MS, ML, MR, NB, FA, PL, PT_BR, PA, RO, RU, SR, SK, SL, SW, SV, TA, TE, TH, TR, UK, UR, UZ, VI, ZU Ejemplo:
"EN"
Respuesta
Respuesta satisfactoria
Cuerpo de respuesta para operaciones con contactos.
Código de idioma del usuario externo.
Opciones disponibles:
ES, EN, AF, SQ, AR, AZ, BN, BG, CA, ZH_CN, HR, CS, DA, NL, ET, FIL, FI, FR, KA, DE, EL, GU, HA, HE, HI, HU, ID, GA, IT, JA, KN, KK, RW_RW, KO, KY_KG, LO, LV, LT, MK, MS, ML, MR, NB, FA, PL, PT_BR, PA, RO, RU, SR, SK, SL, SW, SV, TA, TE, TH, TR, UK, UR, UZ, VI, ZU Ejemplo:
"EN"
¿Esta página le ayudó?

