LeadSquared Developer Centre

ON THIS PAGE

Get Tasks

This downloads our complete API collection, including all endpoints—not just this specific endpoint.
Run in Postman

Returns tasks assigned to a particular owner/user.

  • Pass the “OwnerId” or “OwnerEmailAddress” in the JSON body to specify the owner.
  • You can also provide the additional parameters, “FromDate” and “ToDate” to find tasks between a specific time frame.
  • Use “StatusCode” = “0” to find incomplete tasks and “1” to find completed tasks.

API URL

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

Request

Content-Type: application/json
JSON Body/Payload Icon
{
   "Parameter":{
      "LookupName":"OwnerEmailAddress",
      "LookupValue":"virkdsingh@gmail.com",
      "FromDate":"2017-05-09 18:30:00",
      "ToDate":"2022-05-10 18:29:59",
      "StatusCode":0,
      "TypeName":"0500cfd9-4cf5-11ec-993a-06f221480cd8"
   },
   "Columns":{
      "Exclude_CSV":"ProspectID,FirstName"
   },
   "Sorting":{
      "ColumnName":"Duedate",
      "Direction":"1"
   },
   "Paging":{
      "Offset":0,
      "RowCount":200
   }
}

Request Parameters

Parameter Description
LookupName

Pass “OwnerId” (“UserId”) or or “OwnerEmailAddress” here.

LookupValue

Value of the “OwnerId”.

FromDate

Starting date to search for tasks in UTC (YYYY-MM-DD HH:MM:SS).

ToDate

End date to search for tasks in UTC (YYYY-MM-DD HH:MM:SS).

StatusCode

This is the status code of the task.

  • “StatusCode” = “0” indicates tasks which are incomplete.
  • “StatusCode” = “1” indicates tasks which are complete.
TypeName

The task type Id. You can find it using the Get List of Task Types API.

Exclude_CSV

The columns you don’t want displayed in the response.

ColmnName

The column on which results will be sorted. For example, if you want results to be shown based on creation date, pass “CreatedOn”.

Direction

Direction “1” means descending order and “0” means ascending order.

Offset

The number of results to skip.

RowCount

The number of results to display.

Response

200 OK
Content-Type: application/json
{
   "RecordCount":2,
   "List":[
      {
         "UserTaskId":"04901f02-4d0c-11ec-993a-06f221480cd8",
         "Name":"Document Collection",
         "Category":1,
         "Description":"Collect KYC documents",
         "RelatedEntity":0,
         "DueDate":"2022-02-23 13:10:00.000",
         "Reminder":45,
         "ReminderBeforeDays":0,
         "ReminderTime":"03:30:00",
         "NotifyBy":"1100",
         "StatusCode":0,
         "OwnerId":"3b1041fb-8374-11e7-8758-0a106ee76b21",
         "OwnerName":"Vir Singh",
         "CreatedBy":"1a50c565-8525-11ea-a93b-0aa4c559f4ca",
         "CreatedByName":"Yogesh",
         "CreatedOn":"2021-11-24 09:50:55.000",
         "ModifiedBy":"1a50c565-8525-11ea-a93b-0aa4c559f4ca",
         "ModifiedByName":"Yogesh",
         "ModifiedOn":"2022-02-23 07:00:26.000",
         "RelatedEntityIdName":"",
         "CompletedOn":"0001-01-01 00:00:00.000",
         "TaskType":{
            "Category":1,
            "Color":"",
            "ColumnConfiguration":[
               
            ],
            "CreatedBy":"Srisudhan R",
            "CreatedOn":"/Date(1637737577000+0000)/",
            "FormLayout":"{\"Sections\":[{\"DisplayName\":\"Task Details\",\"Fields\":[{\"SchemaName\":\"OwnerId\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"RelatedEntityId\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Name\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"DueDate\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Reminder\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Description\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"CreatedBy\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"mx_Custom_1\",\"Disabled\":\"False\",\"Colspan\":1}]}],\"AvailableFields\":[{\"SchemaName\":\"Location\",\"Disabled\":\"True\",\"Colspan\":1},{\"SchemaName\":\"Priority\",\"Disabled\":\"False\",\"Colspan\":1},{\"SchemaName\":\"EffortEstimate\",\"Disabled\":\"False\",\"Colspan\":1},{\"SchemaName\":\"PercentCompleted\",\"Disabled\":\"True\",\"Colspan\":1}]}",
            "Id":"0500cfd9-4cf5-11ec-993a-06f221480cd8",
            "IsDefault":false,
            "IsDeleteable":true,
            "IsEditable":true,
            "ModifiedBy":"Srisudhan R",
            "ModifiedOn":"/Date(1637737604000+0000)/",
            "Name":"Document Collection",
            "OpenCompletedTasks":true,
            "PreventConflict":false,
            "ReminderConfiguration":{
               "IsEnable":false
            },
            "Sequence":9,
            "ShowLeadCalendarInvite":null,
            "ShowOrganiserCalendarInvite":null,
            "ShowOwnerCalendarInvite":null,
            "ShowParticipantCalendarInvite":null,
            "Status":1,
            "TaskTypeConfiguration":{
               "BusinessWorkFlow":{
                  "IsEnabled":false,
                  "Status":{
                     "Label":null,
                     "Values":[
                        
                     ]
                  }
               },
               "CalenderInvite":{
                  "Lead":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "Organiser":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "Owner":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "ParticipantUsers":{
                     "IsEnabled":false,
                     "IsSent":null,
                     "Subject":null,
                     "TemplateContent":null
                  }
               },
               "Duration":{
                  "IsEnabled":false,
                  "Value":"tomorrow",
                  "Values":null
               },
               "EffortEstimate":{
                  "IsEnabled":false,
                  "Value":"30",
                  "ValueUnit":"Minute",
                  "Values":null
               },
               "Location":{
                  "GeofenceLocation":false,
                  "GeofenceRange":100,
                  "IsEnabled":false,
                  "IsMandatory":false,
                  "LocationValue":null
               },
               "Priority":{
                  "IsEnabled":false,
                  "Value":null,
                  "Values":null
               },
               "TaskCompleted":{
                  "IsEnabled":false
               }
            }
         },
         "OwnerEmailAddress":"virkdsingh@gmail.com",
         "EndDate":"2022-02-23 13:15:00",
         "PercentCompleted":0,
         "Priority":"",
         "Location":"",
         "CustomFields":{
            "mx_Custom_1":"None"
         }
      },
      {
         "UserTaskId":"fa3ada12-4d0a-11ec-993a-06f221480cd8",
         "Name":"Document Collection",
         "Category":1,
         "Description":"Collect KYC documents",
         "RelatedEntity":0,
         "DueDate":"2022-02-23 13:10:00.000",
         "Reminder":15,
         "ReminderBeforeDays":0,
         "NotifyBy":"1000",
         "StatusCode":0,
         "OwnerId":"3b1041fb-8374-11e7-8758-0a106ee76b21",
         "OwnerName":"Vir Singh",
         "CreatedBy":"1a50c565-8525-11ea-a93b-0aa4c559f4ca",
         "CreatedByName":"Yogesh",
         "CreatedOn":"2021-11-24 09:43:28.000",
         "ModifiedBy":"1a50c565-8525-11ea-a93b-0aa4c559f4ca",
         "ModifiedByName":"Yogesh",
         "ModifiedOn":"2022-02-23 07:00:41.000",
         "RelatedEntityIdName":"",
         "CompletedOn":"0001-01-01 00:00:00.000",
         "TaskType":{
            "Category":1,
            "Color":"",
            "ColumnConfiguration":[
               
            ],
            "CreatedBy":"Srisudhan R",
            "CreatedOn":"/Date(1637737577000+0000)/",
            "FormLayout":"{\"Sections\":[{\"DisplayName\":\"Task Details\",\"Fields\":[{\"SchemaName\":\"OwnerId\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"RelatedEntityId\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Name\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"DueDate\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Reminder\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"Description\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"CreatedBy\",\"Disabled\":\"False\",\"Colspan\":2},{\"SchemaName\":\"mx_Custom_1\",\"Disabled\":\"False\",\"Colspan\":1}]}],\"AvailableFields\":[{\"SchemaName\":\"Location\",\"Disabled\":\"True\",\"Colspan\":1},{\"SchemaName\":\"Priority\",\"Disabled\":\"False\",\"Colspan\":1},{\"SchemaName\":\"EffortEstimate\",\"Disabled\":\"False\",\"Colspan\":1},{\"SchemaName\":\"PercentCompleted\",\"Disabled\":\"True\",\"Colspan\":1}]}",
            "Id":"0500cfd9-4cf5-11ec-993a-06f221480cd8",
            "IsDefault":false,
            "IsDeleteable":true,
            "IsEditable":true,
            "ModifiedBy":"Srisudhan R",
            "ModifiedOn":"/Date(1637737604000+0000)/",
            "Name":"Document Collection",
            "OpenCompletedTasks":true,
            "PreventConflict":false,
            "ReminderConfiguration":{
               "IsEnable":false
            },
            "Sequence":9,
            "ShowLeadCalendarInvite":null,
            "ShowOrganiserCalendarInvite":null,
            "ShowOwnerCalendarInvite":null,
            "ShowParticipantCalendarInvite":null,
            "Status":1,
            "TaskTypeConfiguration":{
               "BusinessWorkFlow":{
                  "IsEnabled":false,
                  "Status":{
                     "Label":null,
                     "Values":[
                        
                     ]
                  }
               },
               "CalenderInvite":{
                  "Lead":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "Organiser":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "Owner":{
                     "IsEnabled":false,
                     "IsSent":false,
                     "Subject":null,
                     "TemplateContent":null
                  },
                  "ParticipantUsers":{
                     "IsEnabled":false,
                     "IsSent":null,
                     "Subject":null,
                     "TemplateContent":null
                  }
               },
               "Duration":{
                  "IsEnabled":false,
                  "Value":"tomorrow",
                  "Values":null
               },
               "EffortEstimate":{
                  "IsEnabled":false,
                  "Value":"30",
                  "ValueUnit":"Minute",
                  "Values":null
               },
               "Location":{
                  "GeofenceLocation":false,
                  "GeofenceRange":100,
                  "IsEnabled":false,
                  "IsMandatory":false,
                  "LocationValue":null
               },
               "Priority":{
                  "IsEnabled":false,
                  "Value":null,
                  "Values":null
               },
               "TaskCompleted":{
                  "IsEnabled":false
               }
            }
         },
         "OwnerEmailAddress":"virkdsingh@gmail.com",
         "EndDate":"2022-02-23 13:15:00",
         "PercentCompleted":0,
         "Priority":"",
         "Location":"",
         "CustomFields":{
            "mx_Custom_1":"None"
         }
      }
   ]
}

HTTP Response Codes

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.

On this page

© 2024 by MarketXpander Services Pvt Ltd. All Rights Reserved.