고객
고객 생성
인증된 워크스페이스(organization_id)에 고객을 생성합니다. 식별자가 하나 이상 필요합니다. 식별자 값은 유형에 맞게 정규화됩니다. 값이 올바르지 않으면 400 VALIDATION_ERROR를 반환합니다. 같은 (type, value)를 이미 사용 중이면 409 CUSTOMER_IDENTIFIER_EXISTS를 반환하며 고객을 생성하지 않습니다. 중복 고객은 생성 후 병합할 수 있습니다.
POST
/
customers
고객 생성
curl --request POST \
--url https://client-api.tryvox.co/v3/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifiers": [
{
"value": "<string>"
}
],
"name": "<string>",
"note": "<string>",
"metadata": {}
}
'import requests
url = "https://client-api.tryvox.co/v3/customers"
payload = {
"identifiers": [{ "value": "<string>" }],
"name": "<string>",
"note": "<string>",
"metadata": {}
}
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({
identifiers: [{value: '<string>'}],
name: '<string>',
note: '<string>',
metadata: {}
})
};
fetch('https://client-api.tryvox.co/v3/customers', 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://client-api.tryvox.co/v3/customers",
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([
'identifiers' => [
[
'value' => '<string>'
]
],
'name' => '<string>',
'note' => '<string>',
'metadata' => [
]
]),
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://client-api.tryvox.co/v3/customers"
payload := strings.NewReader("{\n \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\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://client-api.tryvox.co/v3/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/customers")
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 \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"attributes": {},
"created_at": 123,
"updated_at": 123,
"identifiers": [
{
"id": "<string>",
"identifier_type": "<string>",
"identifier_value": "<string>",
"created_at": 123
}
],
"metadata": {},
"interaction_summary": {
"interaction_count": 123,
"first_interaction_at": 123,
"last_interaction_at": 123,
"last_interaction_id": "<string>",
"last_interaction_type": "<string>"
},
"name": "<string>",
"note": "<string>"
}Authorizations
Body
application/json
생성할 고객 정보입니다. 식별자가 하나 이상 필요합니다.
고객을 생성하는 요청입니다. 조회 후 생성 방식이 아닙니다.\n\n식별자가 하나 이상 필요합니다. 식별자가 없는 고객은 생성할 수 없습니다.
Response
성공 응답
식별자 검색, 생성, 수정, 병합 경로에서 반환하는 고객 응답입니다.
메모리는 고객 단건 조회가 반환하는 CustomerDetailResponse에만 있습니다.
Was this page helpful?
⌘I
고객 생성
curl --request POST \
--url https://client-api.tryvox.co/v3/customers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"identifiers": [
{
"value": "<string>"
}
],
"name": "<string>",
"note": "<string>",
"metadata": {}
}
'import requests
url = "https://client-api.tryvox.co/v3/customers"
payload = {
"identifiers": [{ "value": "<string>" }],
"name": "<string>",
"note": "<string>",
"metadata": {}
}
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({
identifiers: [{value: '<string>'}],
name: '<string>',
note: '<string>',
metadata: {}
})
};
fetch('https://client-api.tryvox.co/v3/customers', 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://client-api.tryvox.co/v3/customers",
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([
'identifiers' => [
[
'value' => '<string>'
]
],
'name' => '<string>',
'note' => '<string>',
'metadata' => [
]
]),
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://client-api.tryvox.co/v3/customers"
payload := strings.NewReader("{\n \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\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://client-api.tryvox.co/v3/customers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://client-api.tryvox.co/v3/customers")
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 \"identifiers\": [\n {\n \"value\": \"<string>\"\n }\n ],\n \"name\": \"<string>\",\n \"note\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"attributes": {},
"created_at": 123,
"updated_at": 123,
"identifiers": [
{
"id": "<string>",
"identifier_type": "<string>",
"identifier_value": "<string>",
"created_at": 123
}
],
"metadata": {},
"interaction_summary": {
"interaction_count": 123,
"first_interaction_at": 123,
"last_interaction_at": 123,
"last_interaction_id": "<string>",
"last_interaction_type": "<string>"
},
"name": "<string>",
"note": "<string>"
}