Skip to main content
Update Task
PUT https://services.leadconnectorhq.com/contacts/{contactId}/tasks/{taskId}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

contactId
string
default:"sx6wyHhbFdRXh302LLNR"
required
Contact Id
taskId
string
default:"ocQHyuzHvysMo5N5VsXc"
required
Task Id

Body

title
string
default:"First Task"
body
string
default:"loram ipsum"
dueDate
string
default:"2020-10-25T11:00:00Z"
completed
boolean
default:"True"
assignedTo
string
default:"hxHGVRb1YJUscrCB8eXK"

Respuestas

task
object
{
  "task": {
    "id": "lJpzYrWdpkC2hX6t2yue",
    "title": "test",
    "body": "testing",
    "assignedTo": "tesTUcmRxWrjqzJS8EjkxNKting",
    "dueDate": "2021-07-08T02:30:00.000Z",
    "completed": true,
    "contactId": "lJpzYrWdpkC2hX6t2yue"
  }
}
{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/contacts/YOUR_contactId/tasks/YOUR_taskId' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "First Task",
  "body": "loram ipsum",
  "dueDate": "2020-10-25T11:00:00Z",
  "completed": true,
  "assignedTo": "hxHGVRb1YJUscrCB8eXK"
}'
const response = await fetch('https://services.leadconnectorhq.com/contacts/YOUR_contactId/tasks/YOUR_taskId', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"title": "First Task", "body": "loram ipsum", "dueDate": "2020-10-25T11:00:00Z", "completed": true, "assignedTo": "hxHGVRb1YJUscrCB8eXK"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/contacts/YOUR_contactId/tasks/YOUR_taskId',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"title": "First Task", "body": "loram ipsum", "dueDate": "2020-10-25T11:00:00Z", "completed": true, "assignedTo": "hxHGVRb1YJUscrCB8eXK"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/contacts/YOUR_contactId/tasks/YOUR_taskId');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'title': 'First Task', 'body': 'loram ipsum', 'dueDate': '2020-10-25T11:00:00Z', 'completed': true, 'assignedTo': 'hxHGVRb1YJUscrCB8eXK'}),
]);
$data = json_decode(curl_exec($ch), true);