Get Teams

Lets you retrieve the teams in your LeadSquared account. You can retrieve teams in hierarchal structure (Parent and child) by passing an additional “getHierarchical” parameter in the query string.

 

API URL

GET
https://{host}/v2/TeamManagement.svc/Retrieve?accessKey=AccessKey&secretKey=SecretKey&getHierarchical=getHierarchical
Copy URL

URL Parameters

Parameter Description
getHierarchical (Optional). Pass the value as "true" to retrieve teams in hierarchical structure.

Response

200 OK

Content-Type: application/json

{
  "FetchedOn": "2019-10-03 05:30:18",
  "RecordCount": 5,
  "Teams": [
    {
      "TeamId": "d384de8a-0bed-11e8-a6d9-069b743e848f",
      "Code": 1,
      "Name": "Provalant Inc",
      "Description": "Default Team for all users",
      "Sequence": 0,
      "ParentId": null,
      "ParentCode": 0,
      "ParentName": null,
      "ModifiedBy": "5c155f0b-dacf-11e9-a0a5-069b743e848f",
      "ModifiedByName": "Shishir Provalant",
      "ModifiedOn": "2019-10-03 05:13:30",
      "WorkDayTemplateId": "638edd94-dffb-11e7-a3a0-069b743e848f",
      "WorkdayTemplateCode": 10,
      "WorkDayTemplateName": "Rohin",
      "IsWorkDayTemplateOverridden": true,
      "HolidayCalendarId": "25cd6bb9-2de1-11e8-802f-069b743e848f",
      "HolidayCalendarCode": 37,
      "HolidayCalendarName": "t2",
      "IsHolidayCalendarOverridden": true,
      "UserCount": 553,
      "Depth": 0,
      "SmartViewId": "6fccf9fd-e59c-11e9-94e4-069b743e848f",
      "SmartViewCode": 28,
      "SmartViewName": "All Tasks",
      "IsSmartViewOverridden": true,
      "ReplaceUserSmartView": "ca50f85c-3d56-11e8-8a27-069b743e848f",
      "IsReplaceUserSmartViewOverridden": true,
      "ChildTeams": [
        {
          "TeamId": "fb516c50-2999-11e8-8db6-069b743e848f",
          "Code": 156,
          "Name": "Americas",
          "Description": "ff",
          "Sequence": 1,
          "ParentId": "d384de8a-0bed-11e8-a6d9-069b743e848f",
          "ParentCode": 1,
          "ParentName": "Provalant Inc",
          "ModifiedBy": "5c155f0b-dacf-11e9-a0a5-069b743e848f",
          "ModifiedByName": "Shishir Provalant",
          "ModifiedOn": "2019-10-03 05:13:31",
          "WorkDayTemplateId": "638edd94-dffb-11e7-a3a0-069b743e848f",
          "WorkdayTemplateCode": 10,
          "WorkDayTemplateName": "Rohin",
          "IsWorkDayTemplateOverridden": false,
          "HolidayCalendarId": "25cd6bb9-2de1-11e8-802f-069b743e848f",
          "HolidayCalendarCode": 37,
          "HolidayCalendarName": "t2",
          "IsHolidayCalendarOverridden": false,
          "UserCount": 0,
          "Depth": 1,
          "SmartViewId": "6fccf9fd-e59c-11e9-94e4-069b743e848f",
          "SmartViewCode": 28,
          "SmartViewName": "All Tasks",
          "IsSmartViewOverridden": false,
          "ReplaceUserSmartView": "ca50f85c-3d56-11e8-8a27-069b743e848f",
          "IsReplaceUserSmartViewOverridden": false,
          "ChildTeams": [
            {
              "TeamId": "cecd5a4a-ddd8-11e9-9a40-069b743e848f",
              "Code": 210,
              "Name": "North America",
              "Description": "",
              "Sequence": 1,
              "ParentId": "fb516c50-2999-11e8-8db6-069b743e848f",
              "ParentCode": 156,
              "ParentName": "Americas",
              "ModifiedBy": "5c155f0b-dacf-11e9-a0a5-069b743e848f",
              "ModifiedByName": "Shishir Provalant",
              "ModifiedOn": "2019-10-03 05:13:31",
              "WorkDayTemplateId": "638edd94-dffb-11e7-a3a0-069b743e848f",
              "WorkdayTemplateCode": 10,
              "WorkDayTemplateName": "Rohin",
              "IsWorkDayTemplateOverridden": false,
              "HolidayCalendarId": "25cd6bb9-2de1-11e8-802f-069b743e848f",
              "HolidayCalendarCode": 37,
              "HolidayCalendarName": "t2",
              "IsHolidayCalendarOverridden": false,
              "UserCount": 0,
              "Depth": 2,
              "SmartViewId": "6fccf9fd-e59c-11e9-94e4-069b743e848f",
              "SmartViewCode": 28,
              "SmartViewName": "All Tasks",
              "IsSmartViewOverridden": false,
              "ReplaceUserSmartView": "ca50f85c-3d56-11e8-8a27-069b743e848f",
              "IsReplaceUserSmartViewOverridden": false,
              "ChildTeams": [
                {
                  "TeamId": "335c7888-dddd-11e9-9a40-069b743e848f",
                  "Code": 220,
                  "Name": "USA",
                  "Description": "",
                  "Sequence": 1,
                  "ParentId": "cecd5a4a-ddd8-11e9-9a40-069b743e848f",
                  "ParentCode": 210,
                  "ParentName": "North America",
                  "ModifiedBy": "5c155f0b-dacf-11e9-a0a5-069b743e848f",
                  "ModifiedByName": "Shishir Provalant",
                  "ModifiedOn": "2019-10-03 05:13:31",
                  "WorkDayTemplateId": "638edd94-dffb-11e7-a3a0-069b743e848f",
                  "WorkdayTemplateCode": 10,
                  "WorkDayTemplateName": "Rohin",
                  "IsWorkDayTemplateOverridden": false,
                  "HolidayCalendarId": "25cd6bb9-2de1-11e8-802f-069b743e848f",
                  "HolidayCalendarCode": 37,
                  "HolidayCalendarName": "t2",
                  "IsHolidayCalendarOverridden": false,
                  "UserCount": 0,
                  "Depth": 3,
                  "SmartViewId": "6fccf9fd-e59c-11e9-94e4-069b743e848f",
                  "SmartViewCode": 28,
                  "SmartViewName": "All Tasks",
                  "IsSmartViewOverridden": false,
                  "ReplaceUserSmartView": "ca50f85c-3d56-11e8-8a27-069b743e848f",
                  "IsReplaceUserSmartViewOverridden": false,
                  "ChildTeams": []
                },
                {
                  "TeamId": "39afef99-dddd-11e9-9a40-069b743e848f",
                  "Code": 221,
                  "Name": "Canada",
                  "Description": "",
                  "Sequence": 2,
                  "ParentId": "cecd5a4a-ddd8-11e9-9a40-069b743e848f",
                  "ParentCode": 210,
                  "ParentName": "North America",
                  "ModifiedBy": "5c155f0b-dacf-11e9-a0a5-069b743e848f",
                  "ModifiedByName": "Shishir Provalant",
                  "ModifiedOn": "2019-10-03 05:13:31",
                  "WorkDayTemplateId": "638edd94-dffb-11e7-a3a0-069b743e848f",
                  "WorkdayTemplateCode": 10,
                  "WorkDayTemplateName": "Rohin",
                  "IsWorkDayTemplateOverridden": false,
                  "HolidayCalendarId": "25cd6bb9-2de1-11e8-802f-069b743e848f",
                  "HolidayCalendarCode": 37,
                  "HolidayCalendarName": "t2",
                  "IsHolidayCalendarOverridden": false,
                  "UserCount": 0,
                  "Depth": 3,
                  "SmartViewId": "6fccf9fd-e59c-11e9-94e4-069b743e848f",
                  "SmartViewCode": 28,
                  "SmartViewName": "All Tasks",
                  "IsSmartViewOverridden": false,
                  "ReplaceUserSmartView": "ca50f85c-3d56-11e8-8a27-069b743e848f",
                  "IsReplaceUserSmartViewOverridden": false,
                  "ChildTeams": []
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

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.