azure-devopspostman

Azure DevOps API : unable to retrieve the child under an area


I can't find the correct postman url to retrieve the children of an area

Hello,

I try to retrieve the children of an Azure DevOps area using Postman. My URL : https://tfs01.red.organisation.com/organisation/project/_apis/wit/classificationnodes/Areas?depth=10&api-version=7.0

The result :

{
    "id": 6,
    "identifier": "c8a8bd02-ffc8-4c49-a2d4-acc2df90f110",
    "name": "ReD",
    "structureType": "area",
    "hasChildren": true,
    "path": "\\ReD\\Area"
}

So if I'm not wrong, to retrieve the children I need to do : https://tfs01.red.organisation.com/organisation/project/_apis/wit/classificationnodes/Areas/Red/Area?depth=10&api-version=7.0

But the return message is :

{
    "$id": "1",
    "innerException": null,
    "message": "VS402485: The Area/Iteration name is not recognized: ReD\\Area",
    "typeName": "Microsoft.TeamFoundation.WorkItemTracking.Server.Metadata.WorkItemTrackingTreeNodeNotFoundException, Microsoft.TeamFoundation.WorkItemTracking.Server",
    "typeKey": "WorkItemTrackingTreeNodeNotFoundException",
    "errorCode": 0,
    "eventId": 3200
}

I missed something but I don't know what... Maybe something with the '\' before the name ? I already tried to escape them with %5C without success, the result is the same

Thanks for any help you can provide


Solution

  • To retrieve the child under an area, you can use REST API Classification Nodes - Get Classification Nodes.

    For example, get the area tree with 3 levels of children.

    GET https://dev.azure.com/{OrgName}/{ProjName}/_apis/wit/classificationnodes/Areas?$depth=3&api-version=7.1-preview.2

    Response:

    {
      "id": 4,
      "identifier": "***",
      "name": "{rootAreaName}",
      "structureType": "area",
      "hasChildren": true,
      "children": [
        ...
        {
          "id": 99,
          "identifier": "***",
          "name": "Team2",
          "structureType": "area",
          "hasChildren": false,
          "path": "\\{rootAreaName}\\Area\\Team2",
          "url": "***"
        },
        {
          "id": 385,
          "identifier": "***",
          "name": "Team1",
          "structureType": "area",
          "hasChildren": true,
          "children": [
            {
              "id": 386,
              "identifier": "***",
              "name": "area1",
              "structureType": "area",
              "hasChildren": false,
              "path": "\\{rootAreaName}\\Area\\Team1\\area1",
              "url": "***"
            }
          ],
          "path": "\\{rootAreaName}\\Area\\Team1",
          "url": "***"
        }
      ],
      "path": "\\{rootAreaName}\\Area",
      "_links": {
        "self": {
          "href": "***"
        }
      },
      "url": "***"
    }