Legacy
Create Task (V1)
Creates a task on the target lead.
Notes:
- content, leadId, deadline, type and assignedRole are required.
- Caller must have manage permission on the lead.
- The response contains only the new task’s ID under the ‘taskId’ key.
POST
/
v1.0
/
tasks
Create Task (V1)
curl --request POST \
--url https://api.lofty.com/v1.0/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": true
}
'import requests
url = "https://api.lofty.com/v1.0/tasks"
payload = {
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": 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({
content: 'Send an email to my lead',
leadId: 563172647619608,
deadline: 1508580010000,
type: 'Call',
assignedRole: 'Agent',
finishFlag: true
})
};
fetch('https://api.lofty.com/v1.0/tasks', 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/tasks",
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([
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'deadline' => 1508580010000,
'type' => 'Call',
'assignedRole' => 'Agent',
'finishFlag' => 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/tasks"
payload := strings.NewReader("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": 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/tasks")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/tasks")
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 \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}"
response = http.request(request)
puts response.read_body{
"taskId": 563172647619608
}"<string>""<string>""<string>"Body
application/json
Task payload.
Description of the task.
Example:
"Send an email to my lead"
ID of the lead this task belongs to.
Example:
563172647619608
Deadline of the task, in milliseconds since Unix epoch (UTC).
Example:
1508580010000
Type of the task.
Available options:
Other, Call, Email, Text Example:
"Call"
Role the task is assigned to.
Available options:
Agent, Assistant Example:
"Agent"
When true on update, the task is marked completed and other fields are ignored.
Example:
true
Response
Task created. Response contains the new task's ID.
Wrapped response for POST /v1.0/tasks. The new task's ID is returned under the 'taskId' key.
ID of the newly created task.
Example:
563172647619608
⌘I
Create Task (V1)
curl --request POST \
--url https://api.lofty.com/v1.0/tasks \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": true
}
'import requests
url = "https://api.lofty.com/v1.0/tasks"
payload = {
"content": "Send an email to my lead",
"leadId": 563172647619608,
"deadline": 1508580010000,
"type": "Call",
"assignedRole": "Agent",
"finishFlag": 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({
content: 'Send an email to my lead',
leadId: 563172647619608,
deadline: 1508580010000,
type: 'Call',
assignedRole: 'Agent',
finishFlag: true
})
};
fetch('https://api.lofty.com/v1.0/tasks', 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/tasks",
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([
'content' => 'Send an email to my lead',
'leadId' => 563172647619608,
'deadline' => 1508580010000,
'type' => 'Call',
'assignedRole' => 'Agent',
'finishFlag' => 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/tasks"
payload := strings.NewReader("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": 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/tasks")
.header("Authorization", "<authorization>")
.header("Content-Type", "<content-type>")
.body("{\n \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.lofty.com/v1.0/tasks")
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 \"content\": \"Send an email to my lead\",\n \"leadId\": 563172647619608,\n \"deadline\": 1508580010000,\n \"type\": \"Call\",\n \"assignedRole\": \"Agent\",\n \"finishFlag\": true\n}"
response = http.request(request)
puts response.read_body{
"taskId": 563172647619608
}"<string>""<string>""<string>"