You've Got Leads API

Making your CRM data work for you.

Tasks

This documentation is currently a preview of what the tasks API will look like. It is not currently released and is subject to change.

The tasks endpoint provides direct access to tasks associated with leads.

The endpoint allows you to retreive tasks for a lead, or to add a new task to a lead.

Requests

Name Method Description
/api/properties/{PropertyId}/leads/{LeadId}/tasks GET Search for tasks associated with the lead, omit filters to retrieve all tasks for a lead
/api/properties/{PropertyId}/leads/{LeadId}/tasks/{TaskId} GET Retrieve a specific task associated with a lead
/api/properties/{PropertyId}/leads/{LeadId}/tasks POST Create a new task for the lead
/api/properties/{PropertyId}/tasks GET Search for tasks associated with a property. You must include the CreatedOn, CompletedDate, or UpdatedOn filters, see examples below.

Request/Response Objects

Tasks

Name Type Description
TaskId int This is the unique identifier for the lead and is only available on GET requests
LeadId int The unique identifier for the lead associated with the task. This value can be null for tasks associated with professional sources
ContactId int The unique identifier for the contact associated with the task. This field is required on POST.
PriorityId int The priority for the task. Allowable values are 1 (high), 2 (medium), or 3 (low). If omitted on POST this defaults to 2.
FollowupDate DateTime The date and optionally the time the task should occur. If a duration is specified, a time is required, and if a time is specified, a duration is required.
TaskTitle string(35) A short description of the task, like a subject line
Status bool Is the task completed? Defaults to false on a POST if omitted.
TaskTypeId int The type of task, see the reference list task-type (coming soon). Required on a POST.
TaskType string Text representation of the task type. Not valid on a POST.
CreatedOn DateTime The date and time the task was originally created. Not valid on a POST.
CreatedBy string(10) The YGL username of the user assigned to the task, see /api/properties/{PropertyId}/users (coming soon) for a list of valid values. If no value is submitted with a POST, a default user will be used.
ChildTaskTypeId int? The child task type. Not valid on a POST. Send the child task type in the TaskTypeId field when creating new tasks, the system will determine the correct parent and child task types.
ChildTaskType string The text representation of the child task type, if present. Not valid on a POST.
IsGroupTask bool Is this task part of a group of tasks. Default on POST is false.
CompletedDate DateTime The date the task was marked as completed. If ommitted on a POST that is marked as completed, will default to the current time.
MadeContactCode string Valid on POST only if the parent task type is a Call, and the task is completed. Possible values are "Yes", "No", and "LM" (left message).
UpdatedOn DateTime The date the task was last updated, not valid on POST.
UpdatedBy string(10) The YGL username of the last person to edit the task.
IsAllDay bool Is the task an all day task? Not valid on POST, will be true if no duration is specified.
Duration int? The duration in minutes of the task. All day tasks will have a value of 1439. Required if the start time is specified.
TimeZoneId string(32) The time zone the task is created for. Must be a value in the reference /api/reference/time-zones (coming soon). Will default to Eastern Standard Time if ommitted on a POST.
OwnerId int The id of the user who is responsible for the task. Will be set to user passed in as CreatedBy or set to a default user if none is specified on POST.
OwnerUsername string(10) The username of the user responsible for the task. Not valid on POST.

Sample GET Requests

https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks
https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks?$filter=CreatedOn+gt+'2014-05-20'
https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks/295314
https://partner-api.youvegotleads.com/api/properties/95774/tasks
https://partner-api.youvegotleads.com/api/properties/95774/tasks?$filter=CreatedOn+gt+'2014-05-20'

Sample GET Response

You will receive a status code of 200 back from the server if the task was successfully created. Any other response such as 500 or 400 means that the task was not created. You will need to inspect the response to determine why the task was not created.

[
    {
        "TaskId": 127284,
        "LeadId": 47882,
        "ContactId": 243851,
        "PriorityId": 2,
        "FollowupDate": "2002-08-17T00:00:00",
        "TaskTitle": "brochure",
        "Status": 1,
        "TaskTypeId": 24,
        "TaskType": "Mail",
        "CreatedOn": "2002-08-19T19:23:00",
        "CreatedBy": "connied",
        "ChildTaskTypeId": null,
        "ChildTaskType": "",
        "IsGroupTask": false,
        "CompletedDate": null,
        "MadeContactCode": null,
        "UpdatedOn": "2011-04-06T22:18:32.03",
        "UpdatedBy": null,
        "IsAllDay": true,
        "Duration": 1439,
        "TimeZoneId": "Eastern Standard Time",
        "OwnerId": 3355,
        "OwnerUsername": "Guest5"
    },
    {
        "TaskId": 133422,
        "LeadId": 47882,
        "ContactId": 243851,
        "PriorityId": 2,
        "FollowupDate": "2002-08-30T00:00:00",
        "TaskTitle": "followup",
        "Status": 1,
        "TaskTypeId": 24,
        "TaskType": "Mail",
        "CreatedOn": "2002-08-30T14:52:00",
        "CreatedBy": "connied",
        "ChildTaskTypeId": null,
        "ChildTaskType": "",
        "IsGroupTask": false,
        "CompletedDate": null,
        "MadeContactCode": null,
        "UpdatedOn": "2011-04-06T22:18:32.03",
        "UpdatedBy": null,
        "IsAllDay": true,
        "Duration": 1439,
        "TimeZoneId": "Eastern Standard Time",
        "OwnerId": 3355,
        "OwnerUsername": "Guest5"
    },
    {
        "TaskId": 133423,
        "LeadId": 47882,
        "ContactId": 243851,
        "PriorityId": 2,
        "FollowupDate": "2002-08-30T00:00:00",
        "TaskTitle": "Scheduled to move in ",
        "Status": 0,
        "TaskTypeId": 31,
        "TaskType": "Move In",
        "CreatedOn": "2002-08-30T14:53:00",
        "CreatedBy": "connied",
        "ChildTaskTypeId": null,
        "ChildTaskType": "",
        "IsGroupTask": false,
        "CompletedDate": null,
        "MadeContactCode": null,
        "UpdatedOn": "2011-04-06T22:18:32.03",
        "UpdatedBy": null,
        "IsAllDay": true,
        "Duration": 1439,
        "TimeZoneId": "Eastern Standard Time",
        "OwnerId": 3355,
        "OwnerUsername": "Guest5"
    }
]

Sample POST Requests

https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks
 
{
    "TaskId": 134910298,
    "LeadId": 47882,
    "ContactId": 243851,
    "PriorityId": 2,
    "FollowupDate": "2002-01-29T00:00:00",
    "TaskTitle": "Inital Call-left msg",
    "Status": true,
    "TaskTypeId": 25,
    "TaskType": "Call",
    "CreatedOn": "2015-02-03T14:44:00",
    "CreatedBy": "AnnA",
    "ChildTaskTypeId": null,
    "ChildTaskType": "",
    "IsGroupTask": false,
    "CompletedDate": "2015-02-03T12:44:07.103",
    "MadeContactCode": "",
    "UpdatedOn": "2015-02-03T14:43:45.833",
    "UpdatedBy": "AnnA",
    "IsAllDay": true,
    "Duration": 1439,
    "TimeZoneId": "Eastern Standard Time",
    "OwnerId": 16956,
    "OwnerUsername": "NancyV"
}

Sample POST Response

You will receive a status code of 201 back from the server if the task was successfully created. Any other response such as 500 or 400 means that the task was not created. You will need to inspect the response to determine why the task was not created.

{
    "TaskId": 134910298,
    "LeadId": 47882,
    "ContactId": 243851,
    "PriorityId": 2,
    "FollowupDate": "2002-01-29T00:00:00",
    "TaskTitle": "Inital Call-left msg",
    "Status": true,
    "TaskTypeId": 25,
    "TaskType": "Call",
    "CreatedOn": "2015-02-03T14:44:00",
    "CreatedBy": "AnnA",
    "ChildTaskTypeId": null,
    "ChildTaskType": "",
    "IsGroupTask": false,
    "CompletedDate": "2015-02-03T12:44:07.103",
    "MadeContactCode": "",
    "UpdatedOn": "2015-02-03T14:43:45.833",
    "UpdatedBy": "AnnA",
    "IsAllDay": true,
    "Duration": 1439,
    "TimeZoneId": "Eastern Standard Time",
    "OwnerId": 16956,
    "OwnerUsername": "NancyV"
}

Sample PUT Request

https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks

[
    {
        "TaskId": 134910263,
        "LeadId": 47882,
        "ContactId": 243851,
        "PriorityId": 2,
        "FollowupDate": "2002-01-29T00:00:00",
        "TaskTitle": "Inital Call-left msg",
        "Status": 1,
        "TaskTypeId": 25,
        "TaskType": "Call",
        "CreatedOn": "2015-02-02T13:06:00",
        "CreatedBy": "AnnA",
        "ChildTaskTypeId": null,
        "ChildTaskType": "",
        "IsGroupTask": false,
        "CompletedDate": "2015-02-02T11:22:43.033",
        "MadeContactCode": "",
        "UpdatedOn": "2015-02-03T12:44:37.313",
        "UpdatedBy": "AnnA",
        "IsAllDay": true,
        "Duration": 1439,
        "TimeZoneId": "Eastern Standard Time",
        "OwnerId": 16956,
        "OwnerUsername": "Guest5"
    }
]

Sample PUT Response

You will receive a status code of 200 back from the server if the task was successfully updated. Any other response such as 500 or 400 means that the task was not updated. You will need to inspect the response to determine why the task was not updated.

[
    {
        "TaskId": 134910263,
        "LeadId": 47882,
        "ContactId": 243851,
        "PriorityId": 2,
        "FollowupDate": "2002-01-29T00:00:00",
        "TaskTitle": "Inital Call-left msg",
        "Status": 1,
        "TaskTypeId": 25,
        "TaskType": "Call",
        "CreatedOn": "2015-02-02T13:06:00",
        "CreatedBy": "AnnA",
        "ChildTaskTypeId": null,
        "ChildTaskType": "",
        "IsGroupTask": false,
        "CompletedDate": "2015-02-02T11:22:43.033",
        "MadeContactCode": "",
        "UpdatedOn": "2015-02-03T12:44:37.313",
        "UpdatedBy": "AnnA",
        "IsAllDay": true,
        "Duration": 1439,
        "TimeZoneId": "Eastern Standard Time",
        "OwnerId": 16956,
        "OwnerUsername": "Guest5"
    }
]

Sample DELETE Request

https://partner-api.youvegotleads.com/api/properties/95774/leads/88817/tasks/295314

Sample DELETE Response

You will receive a status code of 204 back from the server if the task was successfully delete. Any other response such as 500 or 400 means that the task was not deleted. You will need to inspect the response to determine why the task was not deleted.