Create a Meeting
curl --request POST \
--url https://api.affinity.co/v2/meetings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2023-01-01T00:00:00Z",
"attendees": [
{
"person": {
"id": 1
}
},
{
"person": {
"id": 2
}
}
]
}
'import requests
url = "https://api.affinity.co/v2/meetings"
payload = {
"startTime": "2023-01-01T00:00:00Z",
"attendees": [{ "person": { "id": 1 } }, { "person": { "id": 2 } }]
}
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({
startTime: '2023-01-01T00:00:00Z',
attendees: [{person: {id: 1}}, {person: {id: 2}}]
})
};
fetch('https://api.affinity.co/v2/meetings', 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.affinity.co/v2/meetings",
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([
'startTime' => '2023-01-01T00:00:00Z',
'attendees' => [
[
'person' => [
'id' => 1
]
],
[
'person' => [
'id' => 2
]
]
]
]),
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://api.affinity.co/v2/meetings"
payload := strings.NewReader("{\n \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\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://api.affinity.co/v2/meetings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/meetings")
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 \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"loggingType": "automated",
"title": "Example title",
"startTime": "2023-01-01T00:00:00Z",
"endTime": "2023-01-01T00:00:00Z",
"allDay": false,
"creator": {
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
},
"organizer": {
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
},
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"attendeesPreview": {
"data": [
{
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
}
],
"totalCount": 200
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "not-found",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Meetings
Create a Meeting
| ⚠️ This endpoint is currently in BETA |
|---|
Creates a new Meeting logged as a manual interaction. The calling user is recorded as the
meeting’s creator; this cannot be set explicitly. Manually logged meetings have no organizer, so
organizer is always null.
attendees must name at least one internal and one external Person, and must not name the same
Person twice.
A create that repeats the startTime and the attendees of an existing manually logged call or
meeting returns 400, and the error message names the existing interaction’s id.
To attach a note to the created meeting, make a separate call to POST /v2/notes with type
set to interaction and interaction.id set to the new meeting’s id.
POST
/
v2
/
meetings
Create a Meeting
curl --request POST \
--url https://api.affinity.co/v2/meetings \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"startTime": "2023-01-01T00:00:00Z",
"attendees": [
{
"person": {
"id": 1
}
},
{
"person": {
"id": 2
}
}
]
}
'import requests
url = "https://api.affinity.co/v2/meetings"
payload = {
"startTime": "2023-01-01T00:00:00Z",
"attendees": [{ "person": { "id": 1 } }, { "person": { "id": 2 } }]
}
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({
startTime: '2023-01-01T00:00:00Z',
attendees: [{person: {id: 1}}, {person: {id: 2}}]
})
};
fetch('https://api.affinity.co/v2/meetings', 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.affinity.co/v2/meetings",
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([
'startTime' => '2023-01-01T00:00:00Z',
'attendees' => [
[
'person' => [
'id' => 1
]
],
[
'person' => [
'id' => 2
]
]
]
]),
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://api.affinity.co/v2/meetings"
payload := strings.NewReader("{\n \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\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://api.affinity.co/v2/meetings")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.affinity.co/v2/meetings")
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 \"startTime\": \"2023-01-01T00:00:00Z\",\n \"attendees\": [\n {\n \"person\": {\n \"id\": 1\n }\n },\n {\n \"person\": {\n \"id\": 2\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 1,
"loggingType": "automated",
"title": "Example title",
"startTime": "2023-01-01T00:00:00Z",
"endTime": "2023-01-01T00:00:00Z",
"allDay": false,
"creator": {
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
},
"organizer": {
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
},
"createdAt": "2023-01-01T00:00:00Z",
"updatedAt": "2023-01-01T00:00:00Z",
"attendeesPreview": {
"data": [
{
"emailAddress": "john.smith@contoso.com",
"person": {
"id": 1,
"firstName": "Jane",
"lastName": "Doe",
"primaryEmailAddress": "jane.smith@northpointvc.com",
"type": "internal"
}
}
],
"totalCount": 200
}
}{
"errors": [
{
"code": "bad-request",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "not-found",
"message": "<string>"
}
]
}{
"errors": [
{
"code": "authentication",
"message": "<string>"
}
]
}Authorizations
Body
application/json
Request body for creating a Meeting.
Response
Created
Was this page helpful?