Agents
Create a new agent
Creates a new agent under the caller’s team using the supplied profile.
Notes:
- accountInfo.phoneNumber and accountInfo.emailAddress are required.
- When phoneCode is omitted, ‘1’ (US) is used by default.
- When roleName is supplied, it is resolved to the team’s matching role; unknown names are ignored and the agent is created without a role binding.
- Long text fields (address, licenseId, position, personalWebsite, personalIntroduction, social-media item values) are silently truncated to their individual limits.
- The response envelope carries errorCode = 0 on success; non-zero values indicate validation failure or upstream error, with errorMsg describing the cause.
POST
/
v1.0
/
agent
/
profile
/
add
Create a new agent
curl --request POST \
--url https://api.lofty.com/v1.0/agent/profile/add \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"accountType": 123,
"accountInfo": {
"lastName": "Bob",
"firstName": "Bob",
"emailAddress": "aaaa@google.com",
"headUrl": "http://xxx",
"phoneNumber": "83834748",
"phoneCode": "000001",
"phoneCountry": "000001",
"tagIds": [
12345,
67890
],
"sendingEmail": "<string>",
"domain": "<string>",
"allowChangeDomain": true,
"roleName": "role of the agent",
"groupId": 123,
"roleId": 123,
"seatTypeName": "Full Time Agent"
},
"workInfo": {
"streetAddress": "123 Main St",
"city": "New York",
"country": "US",
"state": "NY",
"zipcode": "10001",
"licenseId": "xxx",
"companyName": "xxx",
"companyAddress": "xxx",
"position": "xxx",
"personalWebsite": "xxx",
"personalAttachments": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalDisclaimers": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalIntroduction": "xxx"
},
"socialMedias": {
"items": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>"
}
]
},
"personalPhotos": {
"urls": [
"<string>"
]
},
"hasBackOffice": true,
"agentPid": "<string>",
"fullSync": true,
"shouldSync": true,
"checkRosterNum": true
}
'import requests
url = "https://api.lofty.com/v1.0/agent/profile/add"
payload = {
"accountType": 123,
"accountInfo": {
"lastName": "Bob",
"firstName": "Bob",
"emailAddress": "aaaa@google.com",
"headUrl": "http://xxx",
"phoneNumber": "83834748",
"phoneCode": "000001",
"phoneCountry": "000001",
"tagIds": [12345, 67890],
"sendingEmail": "<string>",
"domain": "<string>",
"allowChangeDomain": True,
"roleName": "role of the agent",
"groupId": 123,
"roleId": 123,
"seatTypeName": "Full Time Agent"
},
"workInfo": {
"streetAddress": "123 Main St",
"city": "New York",
"country": "US",
"state": "NY",
"zipcode": "10001",
"licenseId": "xxx",
"companyName": "xxx",
"companyAddress": "xxx",
"position": "xxx",
"personalWebsite": "xxx",
"personalAttachments": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalDisclaimers": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalIntroduction": "xxx"
},
"socialMedias": { "items": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>"
}
] },
"personalPhotos": { "urls": ["<string>"] },
"hasBackOffice": True,
"agentPid": "<string>",
"fullSync": True,
"shouldSync": True,
"checkRosterNum": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
accountType: 123,
accountInfo: {
lastName: 'Bob',
firstName: 'Bob',
emailAddress: 'aaaa@google.com',
headUrl: 'http://xxx',
phoneNumber: '83834748',
phoneCode: '000001',
phoneCountry: '000001',
tagIds: [12345, 67890],
sendingEmail: '<string>',
domain: '<string>',
allowChangeDomain: true,
roleName: 'role of the agent',
groupId: 123,
roleId: 123,
seatTypeName: 'Full Time Agent'
},
workInfo: {
streetAddress: '123 Main St',
city: 'New York',
country: 'US',
state: 'NY',
zipcode: '10001',
licenseId: 'xxx',
companyName: 'xxx',
companyAddress: 'xxx',
position: 'xxx',
personalWebsite: 'xxx',
personalAttachments: [
{
fileName: '<string>',
size: 123,
queryLink: '<string>',
contentType: '<string>'
}
],
personalDisclaimers: [
{
fileName: '<string>',
size: 123,
queryLink: '<string>',
contentType: '<string>'
}
],
personalIntroduction: 'xxx'
},
socialMedias: {items: [{type: '<string>', name: '<string>', value: '<string>'}]},
personalPhotos: {urls: ['<string>']},
hasBackOffice: true,
agentPid: '<string>',
fullSync: true,
shouldSync: true,
checkRosterNum: true
})
};
fetch('https://api.lofty.com/v1.0/agent/profile/add', 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.lofty.com/v1.0/agent/profile/add",
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([
'accountType' => 123,
'accountInfo' => [
'lastName' => 'Bob',
'firstName' => 'Bob',
'emailAddress' => 'aaaa@google.com',
'headUrl' => 'http://xxx',
'phoneNumber' => '83834748',
'phoneCode' => '000001',
'phoneCountry' => '000001',
'tagIds' => [
12345,
67890
],
'sendingEmail' => '<string>',
'domain' => '<string>',
'allowChangeDomain' => true,
'roleName' => 'role of the agent',
'groupId' => 123,
'roleId' => 123,
'seatTypeName' => 'Full Time Agent'
],
'workInfo' => [
'streetAddress' => '123 Main St',
'city' => 'New York',
'country' => 'US',
'state' => 'NY',
'zipcode' => '10001',
'licenseId' => 'xxx',
'companyName' => 'xxx',
'companyAddress' => 'xxx',
'position' => 'xxx',
'personalWebsite' => 'xxx',
'personalAttachments' => [
[
'fileName' => '<string>',
'size' => 123,
'queryLink' => '<string>',
'contentType' => '<string>'
]
],
'personalDisclaimers' => [
[
'fileName' => '<string>',
'size' => 123,
'queryLink' => '<string>',
'contentType' => '<string>'
]
],
'personalIntroduction' => 'xxx'
],
'socialMedias' => [
'items' => [
[
'type' => '<string>',
'name' => '<string>',
'value' => '<string>'
]
]
],
'personalPhotos' => [
'urls' => [
'<string>'
]
],
'hasBackOffice' => true,
'agentPid' => '<string>',
'fullSync' => true,
'shouldSync' => true,
'checkRosterNum' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/agent/profile/add"
payload := strings.NewReader("{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v1.0/agent/profile/add")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/agent/profile/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}"
response = http.request(request)
puts response.read_body{
"data": 100234,
"errorCode": 0,
"errorMsg": "<string>"
}{
"data": 123,
"errorCode": 123,
"errorMsg": "<string>",
"errorData": {}
}{
"data": 123,
"errorCode": 123,
"errorMsg": "<string>",
"errorData": {}
}Body
application/json
Agent profile payload.
The account type of the agent
Account Base Info of agent, like name , email or phone and something else
Show child attributes
Show child attributes
Work Info of agent, include company info etc..
Show child attributes
Show child attributes
Social media of agent, include company info
Show child attributes
Show child attributes
Personal photos of agent
Show child attributes
Show child attributes
Response
Envelope with the new agent's user ID, or a non-zero errorCode on failure.
Response for POST /v1.0/agent/profile/add. Envelope that carries the new agent's user ID and an error code when creation fails.
⌘I
Create a new agent
curl --request POST \
--url https://api.lofty.com/v1.0/agent/profile/add \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"accountType": 123,
"accountInfo": {
"lastName": "Bob",
"firstName": "Bob",
"emailAddress": "aaaa@google.com",
"headUrl": "http://xxx",
"phoneNumber": "83834748",
"phoneCode": "000001",
"phoneCountry": "000001",
"tagIds": [
12345,
67890
],
"sendingEmail": "<string>",
"domain": "<string>",
"allowChangeDomain": true,
"roleName": "role of the agent",
"groupId": 123,
"roleId": 123,
"seatTypeName": "Full Time Agent"
},
"workInfo": {
"streetAddress": "123 Main St",
"city": "New York",
"country": "US",
"state": "NY",
"zipcode": "10001",
"licenseId": "xxx",
"companyName": "xxx",
"companyAddress": "xxx",
"position": "xxx",
"personalWebsite": "xxx",
"personalAttachments": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalDisclaimers": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalIntroduction": "xxx"
},
"socialMedias": {
"items": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>"
}
]
},
"personalPhotos": {
"urls": [
"<string>"
]
},
"hasBackOffice": true,
"agentPid": "<string>",
"fullSync": true,
"shouldSync": true,
"checkRosterNum": true
}
'import requests
url = "https://api.lofty.com/v1.0/agent/profile/add"
payload = {
"accountType": 123,
"accountInfo": {
"lastName": "Bob",
"firstName": "Bob",
"emailAddress": "aaaa@google.com",
"headUrl": "http://xxx",
"phoneNumber": "83834748",
"phoneCode": "000001",
"phoneCountry": "000001",
"tagIds": [12345, 67890],
"sendingEmail": "<string>",
"domain": "<string>",
"allowChangeDomain": True,
"roleName": "role of the agent",
"groupId": 123,
"roleId": 123,
"seatTypeName": "Full Time Agent"
},
"workInfo": {
"streetAddress": "123 Main St",
"city": "New York",
"country": "US",
"state": "NY",
"zipcode": "10001",
"licenseId": "xxx",
"companyName": "xxx",
"companyAddress": "xxx",
"position": "xxx",
"personalWebsite": "xxx",
"personalAttachments": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalDisclaimers": [
{
"fileName": "<string>",
"size": 123,
"queryLink": "<string>",
"contentType": "<string>"
}
],
"personalIntroduction": "xxx"
},
"socialMedias": { "items": [
{
"type": "<string>",
"name": "<string>",
"value": "<string>"
}
] },
"personalPhotos": { "urls": ["<string>"] },
"hasBackOffice": True,
"agentPid": "<string>",
"fullSync": True,
"shouldSync": True,
"checkRosterNum": True
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "<content-type>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': '<content-type>'},
body: JSON.stringify({
accountType: 123,
accountInfo: {
lastName: 'Bob',
firstName: 'Bob',
emailAddress: 'aaaa@google.com',
headUrl: 'http://xxx',
phoneNumber: '83834748',
phoneCode: '000001',
phoneCountry: '000001',
tagIds: [12345, 67890],
sendingEmail: '<string>',
domain: '<string>',
allowChangeDomain: true,
roleName: 'role of the agent',
groupId: 123,
roleId: 123,
seatTypeName: 'Full Time Agent'
},
workInfo: {
streetAddress: '123 Main St',
city: 'New York',
country: 'US',
state: 'NY',
zipcode: '10001',
licenseId: 'xxx',
companyName: 'xxx',
companyAddress: 'xxx',
position: 'xxx',
personalWebsite: 'xxx',
personalAttachments: [
{
fileName: '<string>',
size: 123,
queryLink: '<string>',
contentType: '<string>'
}
],
personalDisclaimers: [
{
fileName: '<string>',
size: 123,
queryLink: '<string>',
contentType: '<string>'
}
],
personalIntroduction: 'xxx'
},
socialMedias: {items: [{type: '<string>', name: '<string>', value: '<string>'}]},
personalPhotos: {urls: ['<string>']},
hasBackOffice: true,
agentPid: '<string>',
fullSync: true,
shouldSync: true,
checkRosterNum: true
})
};
fetch('https://api.lofty.com/v1.0/agent/profile/add', 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.lofty.com/v1.0/agent/profile/add",
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([
'accountType' => 123,
'accountInfo' => [
'lastName' => 'Bob',
'firstName' => 'Bob',
'emailAddress' => 'aaaa@google.com',
'headUrl' => 'http://xxx',
'phoneNumber' => '83834748',
'phoneCode' => '000001',
'phoneCountry' => '000001',
'tagIds' => [
12345,
67890
],
'sendingEmail' => '<string>',
'domain' => '<string>',
'allowChangeDomain' => true,
'roleName' => 'role of the agent',
'groupId' => 123,
'roleId' => 123,
'seatTypeName' => 'Full Time Agent'
],
'workInfo' => [
'streetAddress' => '123 Main St',
'city' => 'New York',
'country' => 'US',
'state' => 'NY',
'zipcode' => '10001',
'licenseId' => 'xxx',
'companyName' => 'xxx',
'companyAddress' => 'xxx',
'position' => 'xxx',
'personalWebsite' => 'xxx',
'personalAttachments' => [
[
'fileName' => '<string>',
'size' => 123,
'queryLink' => '<string>',
'contentType' => '<string>'
]
],
'personalDisclaimers' => [
[
'fileName' => '<string>',
'size' => 123,
'queryLink' => '<string>',
'contentType' => '<string>'
]
],
'personalIntroduction' => 'xxx'
],
'socialMedias' => [
'items' => [
[
'type' => '<string>',
'name' => '<string>',
'value' => '<string>'
]
]
],
'personalPhotos' => [
'urls' => [
'<string>'
]
],
'hasBackOffice' => true,
'agentPid' => '<string>',
'fullSync' => true,
'shouldSync' => true,
'checkRosterNum' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$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.lofty.com/v1.0/agent/profile/add"
payload := strings.NewReader("{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "<content-type>")
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.lofty.com/v1.0/agent/profile/add")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/agent/profile/add")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = '<content-type>'
request.body = "{\n \"accountType\": 123,\n \"accountInfo\": {\n \"lastName\": \"Bob\",\n \"firstName\": \"Bob\",\n \"emailAddress\": \"aaaa@google.com\",\n \"headUrl\": \"http://xxx\",\n \"phoneNumber\": \"83834748\",\n \"phoneCode\": \"000001\",\n \"phoneCountry\": \"000001\",\n \"tagIds\": [\n 12345,\n 67890\n ],\n \"sendingEmail\": \"<string>\",\n \"domain\": \"<string>\",\n \"allowChangeDomain\": true,\n \"roleName\": \"role of the agent\",\n \"groupId\": 123,\n \"roleId\": 123,\n \"seatTypeName\": \"Full Time Agent\"\n },\n \"workInfo\": {\n \"streetAddress\": \"123 Main St\",\n \"city\": \"New York\",\n \"country\": \"US\",\n \"state\": \"NY\",\n \"zipcode\": \"10001\",\n \"licenseId\": \"xxx\",\n \"companyName\": \"xxx\",\n \"companyAddress\": \"xxx\",\n \"position\": \"xxx\",\n \"personalWebsite\": \"xxx\",\n \"personalAttachments\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalDisclaimers\": [\n {\n \"fileName\": \"<string>\",\n \"size\": 123,\n \"queryLink\": \"<string>\",\n \"contentType\": \"<string>\"\n }\n ],\n \"personalIntroduction\": \"xxx\"\n },\n \"socialMedias\": {\n \"items\": [\n {\n \"type\": \"<string>\",\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ]\n },\n \"personalPhotos\": {\n \"urls\": [\n \"<string>\"\n ]\n },\n \"hasBackOffice\": true,\n \"agentPid\": \"<string>\",\n \"fullSync\": true,\n \"shouldSync\": true,\n \"checkRosterNum\": true\n}"
response = http.request(request)
puts response.read_body{
"data": 100234,
"errorCode": 0,
"errorMsg": "<string>"
}{
"data": 123,
"errorCode": 123,
"errorMsg": "<string>",
"errorData": {}
}{
"data": 123,
"errorCode": 123,
"errorMsg": "<string>",
"errorData": {}
}