Create a To-Do

Lets you create a new to-do type task. There are 2 ways to use this API –

  • You can create a task and associate it with a lead by passing the “RelatedEntity” parameter as “1” and then passing the “LeadId” as the value for the “RelatedEntityId” parameter.
  • You can create a task without associating it with a lead. In this case, pass the “RelatedEntity” parameter as “0” and don’t pass any value for the “RelatedEntityId” parameter.

You can either provide the “OwnerId” or “OwnerEmailAddress” in the JSON body. The “TaskType” is the type of task you want to create. To retrieve the list of task types, use the Get list of Task Types API.

Note: The “Due Date” and “EndDate” parameters are optional. If you don’t pass them, the due date and end date will be taken as the current day.

 

API URL

POST
https://{host}/v2/Task.svc/Create?accessKey=AccessKey&secretKey=SecretKey
Copy URL

Request

JSON Body/Payload

Content-Type: application/json

{
  "Name": "Todo: Item",
  "Description": "Describing the task",
  "RelatedEntity": 0,
  "RelatedEntityId": "",
  "DueDate": "2020-11-11 10:30:00",
  "EndDate": "2020-11-12 10:29:00",
  "ReminderBeforeDays": "1",
  "ReminderTime": "10:00:00",
  "NotifyBy": "1100",
  "OwnerEmailAddress": " taskowner@example.com",
  "TaskType": {
    "Name": "Revive Old Lead"
  }
}

JSON Properties

Parameter Description
Name

Name of the task. You may pass any string value here.

Description

Description of the task.

RelatedEntity

Set this to “0” if you’re not passing any value to the “RelatedEntityId” (which is the “LeadId” or “ProspectId”) ;

Pass the value as “1” if you’re passing the “RelatedEntityId”.

RelatedEntityId

“LeadId” you want to associate the task with. It will be considered only if “RelatedEntity” = “1”.

DueDate

Due date of task in “yyyy-mm-dd hh:mm:ss” format.

EndDate

The end date of the task in “yyyy-mm-dd hh:mm:ss” format. The task will remain ‘Pending’ until the end date, after which it will become ‘Overdue’.

ReminderBeforeDays

The number of days before the due date you want the task owner to receive a reminder.

ReminderTime

The reminder will be received by the task owner at the time specified here* on the day specified in the “ReminderBeforeDays” parameter.

*time must be passed in “hh:mm:ss” format.

NotifyBy

Set the value as 1100 if you want the task owner to be notified by email.

Set the value as 1000 if you don’t want any notifications.

OwnerId

Id of the user you’re assigning the task to. You may pass either this or the “OwnerEmailAddress”.

OwnerEmailAddress

Email address of the user you’re assigning the task to (when “OwnerId” is not known).

Response

200 OK

Content-Type: application/json

{
   "Status":"Success",
   "Message":{
              "Id":"xxxxxxxx-Task-Idxx-xxxx-xxxxxxxxxxxx"
             }
}

HTTP Response Code

Code Description
200 OK

This is the status code for successful API call.

401 Unauthorized

The API call was made with invalid access credentials. Check your AccessKey and SecretKey.

400 Bad Request

The message body on the request is not as per API specification. Make sure that content type is set to “application/json” and the JSON body has correct attribute names and structure.

404 Not Found

The API could not be found. Please check the API signature.

429 Too Many Requests

API calls exceeded the limit of 25 in 5 second(s)

500 Internal Server Error

The API called failed. There could be many reasons for it. Check the exception message to get more details.