Create Relation.Documentation Link - https://doc.clickup.com/8631005/d/h/87cpx-293776/cd0f4122abc04d3
POST https://services.leadconnectorhq.com/associations/relations
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Body
locationId
string
default: "clF1LD04GTUKN3b3XuOj"
required
Your Sub Account’s ID
associationId
string
default: "ve9EPM428h8vShlRW1KT"
required
Association’s Id
firstRecordId
string
default: "ve9EPM428h8vShlRW1KT"
required
First Record’s Id. For instance, if you have an association between a contact and a custom object, and you specify the contact as the first object while creating the association, then your firstRecordId would be the contactId
secondRecordId
string
default: "ve9EPM428h8vShlRW1KT"
required
Second Record’s Id.For instance, if you have an association between a contact and a custom object, and you specify the custom object as the second entity while creating the association, then your secondRecordId would be the customObject record Id
Respuestas
201 - Successful response
locationId
string
default: "string"
required
id
string
default: "ve9EPM428h8vShlRW1KT"
required
key
string
default: "student"
required
First Objects Association Label (custom_objects.children)
firstObjectLabel
object
default: "student"
required
First Objects Association Label (custom_objects.children)
firstObjectKey
object
default: "custom_objects.children"
required
First Objects Key
secondObjectLabel
object
default: "Teacher"
required
Second Object Association Label (contact)
secondObjectKey
object
default: "contact"
required
Second Objects Key
associationType
object
default: "USER_DEFINED"
required
Association Type can be USER_DEFINED or SYSTEM_DEFINED
{
"locationId" : "string" ,
"id" : "ve9EPM428h8vShlRW1KT" ,
"key" : "student" ,
"firstObjectLabel" : "student" ,
"firstObjectKey" : "custom_objects.children" ,
"secondObjectLabel" : "Teacher" ,
"secondObjectKey" : "contact" ,
"associationType" : "USER_DEFINED"
}
422 - Unprocessable Entity
Ejemplo
curl -X POST 'https://services.leadconnectorhq.com/associations/relations' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "clF1LD04GTUKN3b3XuOj",
"associationId": "ve9EPM428h8vShlRW1KT",
"firstRecordId": "ve9EPM428h8vShlRW1KT",
"secondRecordId": "ve9EPM428h8vShlRW1KT"
}'
const response = await fetch ( 'https://services.leadconnectorhq.com/associations/relations' , {
method: 'POST' ,
headers: {
Authorization: `Bearer ${ process . env . LEADWAY_TOKEN } ` ,
Version: '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
body: JSON . stringify ({ "locationId" : "clF1LD04GTUKN3b3XuOj" , "associationId" : "ve9EPM428h8vShlRW1KT" , "firstRecordId" : "ve9EPM428h8vShlRW1KT" , "secondRecordId" : "ve9EPM428h8vShlRW1KT" }),
});
const data = await response . json ();
import os, requests
response = requests.request(
'POST' ,
'https://services.leadconnectorhq.com/associations/relations' ,
headers = {
'Authorization' : f "Bearer { os.environ[ 'LEADWAY_TOKEN' ] } " ,
'Version' : '2021-07-28' ,
'Content-Type' : 'application/json' ,
},
json = { "locationId" : "clF1LD04GTUKN3b3XuOj" , "associationId" : "ve9EPM428h8vShlRW1KT" , "firstRecordId" : "ve9EPM428h8vShlRW1KT" , "secondRecordId" : "ve9EPM428h8vShlRW1KT" },
)
data = response.json()
<? php
$ch = curl_init ( 'https://services.leadconnectorhq.com/associations/relations' );
curl_setopt_array ( $ch , [
CURLOPT_RETURNTRANSFER => true ,
CURLOPT_CUSTOMREQUEST => 'POST' ,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv ( 'LEADWAY_TOKEN' ),
'Version: 2021-07-28' ,
'Content-Type: application/json' ,
],
CURLOPT_POSTFIELDS => json_encode ({ 'locationId' : 'clF1LD04GTUKN3b3XuOj' , 'associationId' : 've9EPM428h8vShlRW1KT' , 'firstRecordId' : 've9EPM428h8vShlRW1KT' , 'secondRecordId' : 've9EPM428h8vShlRW1KT' }),
]);
$data = json_decode ( curl_exec ( $ch ), true );