You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 41 Next »

Structure Service


Structure Service


A hierarchical tree structure(eg: cost structure) could be added and later retrieved from a project/object using the Structure service

 

Create a new structure in a project
    Resource: projects/<project_id>/structures 

    URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/structures

    Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/structures

    JSON Structure

    Name

    Mandatory / Optional

    Type

    Description

    parentId

    mandatory

    string(guid)

    Parent node id of the structure (for the first structure, projectId is the parentId)

    name

    mandatory

    string

    Name of the structure

    description

    optional

    string

    Description of the structure

    type optional string Type of the structure (eg: costStructure, specificationStructure)
    nr will be ignored integer The index of the structure
    color optional integer Color of the structure
    id will be ignored string(guid) Unique guid of the structure
    startDate optional string (date) Start date ( depends on type of structure )
    endDate optional string (date) End date ( depends on type of structure )
    attributeId optional string(guid)

    Free attribute Id.
    When this value is set, the corresponding attribute must have a suitable controlType
    to define set of structures to be created. At a moment is supported only controlType "Enumeration",
    for all other controlType-s is returned status 404 Not found.

    variantType optional string(guid) Variant Type Id to whom the object will be assigned.
    Used only when attributeId is defined.


     POST

     Create a new structure(eg: cost structure, specification structure) under a project.

    NOTE :
    When is defined attributeId of attribute with controlType "Enumeration" will be created structure hierarchy.
    The structure will be created under parent element (structure or project) together with its child structures.
    Child structures will be created according enumDefinition (enumeration list) of attribute (defined by attributeId).

    Headers
    Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
    Content-Type: application/json
    
    JSON
    A) Sample to create single structure:
    {
       "parentId": "3904db18-cf1a-4665-9c2b-152b84293259",
       "name": "TestStructure",
       "description": "FullLifeCycleTest",
       "type": "CostStructure"
    }
     
    B) Sample to create structure hierarchy:
    {
       "parentId": "3904db18-cf1a-4665-9c2b-152b84293259",
       "name": "Status structure",
       "attributeId": "02bbe8de-c623-489f-9baa-87f8ff3205f2",
       "description": "Status of the project (enumeration)"
    }
    
    
    Status
    Status: 201 Created
    
    JSON
    A) Sample to create single structure:
    {
       "parentId": "3904db18-cf1a-4665-9c2b-152b84293259",
        "name": "TestStructure",
        "description": "FullLifeCycleTest",
        "type": "CostStructure",
        "nr": 1,
        "color": 0,
        "id": "179439d6-df16-41cc-bd2c-74d05b7995d5"
    }
     
    B) Sample to create structure hierarchy:
    {
      "projectId": "3904db18-cf1a-4665-9c2b-152b84293259",
      "name": "Status structure",
      "description": "Status of the project (enumeration)",
      "type": "mainStructure2",
      "nr": 0,
      "id": "ee209608-19b1-40da-a089-53b20a858d41",
      "structuretypeid": "14c1ca64-4001-438f-a2f6-77ca951c488d",
    
    
      "children": [
        {
          "structuretypeid": "14c1ca64-4001-438f-a2f6-77ca951c488d",
          "children": [],
          "elements": [],
          "parentId": "ee209608-19b1-40da-a089-53b20a858d41",
          "name": "Undefined",
          "description": "0",
          "type": "mainStructure2",
          "nr": 0,
          "id": "40da49c5-3f3a-4e12-a4f8-94fb829c7c1e"
        },
        {
          "structuretypeid": "14c1ca64-4001-438f-a2f6-77ca951c488d",
          "children": [],
          "elements": [],
          "parentId": "ee209608-19b1-40da-a089-53b20a858d41",
          "name": "in planning stage",
          "description": "1",
          "type": "mainStructure2",
          "nr": 0,
          "id": "ecf9c518-1e24-4706-8557-d29d75fb7ddc"
        },
        ......
      ],
    
      "elements": []
    }
    
    
    
     

    Get the structure details
      Resource: structures/<structure_id> 

      URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>

      Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5

       GET
       Get details of a specified structure.
      Headers
      Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
      Content-Type: application/json
      
      Status
      Status: 200 OK
      
      JSON
      {
          "name": "TestStructure",
          "description": "FullLifeCycleTest",
          "type": "CostStructure",
          "nr": 1,
          "color": 0,
          "id": "179439d6-df16-41cc-bd2c-74d05b7995d5"
      }

      Create a sub-node under the structure
        Resource: structures/<structure_id> 

        URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id> 

        Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5

        JSON Structure

        Name

        Mandatory / Optional

        Type

        Description

        parentId

        mandatory

        string(guid)

        Parent node id of the structure (the id specified in the resource url)

        name

        mandatory

        string

        Name of the structure

        description

        optional

        string

        Description of the structure

        type optional string Type of the structure (eg: costStructure, specificationStructure)
        nr will be ignored integer The index of the structure
        color optional integer Color of the structure
        id will be ignored string(guid) Unique guid of the structure


         POST
         Create a sub-node under a particular structure
        Headers
        Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
        Content-Type: application/json
        
        JSON
        {
          "name": "Node 1"
        }
        Status
        Status: 201 Created
        
        JSON
        {
            "parentId": "179439d6-df16-41cc-bd2c-74d05b7995d5",
            "name": "Node 1",
            "type": "TopologyStructure",
            "nr": 1,
            "color": 0,
            "id": "adf506ae-3628-4501-9af1-22bcf27e4ab4"
        }

        Get the structure topology
          Resource: structures/<structure_id>/topology?varianttype=<varianttype_id> 

          URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>/topology?varianttype=<varianttype_id>

          Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5/topology?varianttype=733e429a-e232-4e5d-a41e-9bd50aa9763c

          Optional query parameters

          Name Type Default value Description
          varianttype string (guid) Guid.Empty id of the variant type


           GET
           Get details of a specified structure.
          Headers
          Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
          Content-Type: application/json
          
          Status
          Status: 200 OK
          
          JSON
          {
              "parent": null,
              "name": "TestStructure",
              "type": "Structure",
              "children": [
                  {
                      "parent": "179439d6-df16-41cc-bd2c-74d05b7995d5",
                      "name": "Node 1",
                      "type": "Structure",
                      "children": [],
                      "id": "adf506ae-3628-4501-9af1-22bcf27e4ab4"
                  }
              ],
              "id": "179439d6-df16-41cc-bd2c-74d05b7995d5"
          }

          Reorder the structure
            Resource: structures/<structure_id>/reorder?varianttype=<varianttype_id> 

            URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>/reorder?varianttype=<varianttype_id>

            Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5/reorder?varianttype=733e429a-e232-4e5d-a41e-9bd50aa9763c

            Optional query parameters

            Name Type Default value Description
            varianttype string (guid) Guid.Empty id of the variant type


             PUT
             Reorder the structure for specified variant type.
            Headers
            Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
            Content-Type: application/json
            
            Status
            Status: 200 OK
            
            JSON
            {
                "parent": null,
                "name": "TestStructure",
                "type": "Structure",
                "children": [
                    {
                        "parent": "179439d6-df16-41cc-bd2c-74d05b7995d5",
                        "name": "Node 1",
                        "type": "Structure",
                        "children": [],
                        "id": "adf506ae-3628-4501-9af1-22bcf27e4ab4"
                    }
                ],
                "id": "179439d6-df16-41cc-bd2c-74d05b7995d5"
            }

             

            Assign an object to the latest/last structure node
              Resource: structures/<structure_id>/assign/<object_id> 

              URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>/assign/<object_id> 

              Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5/assign/df4a81d6-42fb-4187-bbce-82a2fc093b2f

              JSON Structure

              Name

              Mandatory / Optional

              Type

              Description

              color

              optional

              string(guid)

              The id of the last node to which an object will be assigned

              objectId

              will be ignored

              string(guid)

              The id of the object to whom a structure will be assigned

              name

              mandatory

              string

              The name of the structure-object connection

              nr will be ignored integer The index of the structure-object connection
              id will be ignored string(guid) Unique guid of the structure-object connection
              variantType optional string(guid) Variant Type Id to whom the object will be assigned
              IfcGloballyUniqueId optional string IFC globally unique ID


               POST

               Assign an object to the latest/last structure node

               

              Note :

              Works with two different inputs

              1. Object ID is present in the url - this object ID is used
              2. Object ID is not present, but content json contains IfcGloballyUniqueId - a corresponding Bimplus object is found and used as input object ID
                - if this IFC id is not found -> return "404 Not Found", if present multiple times -> return "409 Conflict"

              Headers
              Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
              Content-Type: application/json
              
              JSON
              {
                "name": "WallConnection",
                "variantType" : "35b986c2-e9cd-482e-9281-6000671a49f0"
              }
              Status
              Status: 201 Created
              
              JSON
              {
                  "structureId": "adf506ae-3628-4501-9af1-22bcf27e4ab4",
                  "objectId": "df4a81d6-42fb-4187-bbce-82a2fc093b2f",
                  "name": "WallConnection",
                  "nr": 1,
                  "id": "35b986c2-e9cd-482e-9281-6000671a49f0"
              }


              Assign additional objects to the latest structureElement node

                 Resource: structures/<structureElement_id>/assign/<object_id> 

                URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structureElement_id>/assign/<object_id> 

                Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5/assign/df4a81d6-42fb-4187-bbce-82a2fc093b2f

                POST

                {
                    "structureId": "adf506ae-3628-4501-9af1-22bcf27e4ab4",
                    "objectId": "df4a81d6-42fb-4187-bbce-82a2fc093b2f",
                    "name": "WallConnection",
                    "nr": 1,
                    "id": "35b986c2-e9cd-482e-9281-6000671a49f0",
                    "variantType" : "35b986c2-e9cd-482e-9281-6000671a49f0"
                }

                 

                Remove assigned object from the latest structureElement node

                  Resource: structures/<structureElement_id>/delete/<object_id> 

                  URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structureElement_id>/delete/<object_id> 

                  Example: https://api-stage.bimplus.net/v2/bimplus/structures/35b986c2-e9cd-482e-9281-6000671a49f0/delete/df4a81d6-42fb-4187-bbce-82a2fc093b2f


                   DELETE

                  HttpStatusCode.OK

                  Copy Structure

                    Resource: structures/<structure_id>/copy

                    URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>/copy?varianttype=<varianttype_id>

                    Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5/copy?varianttype=733e429a-e232-4e5d-a41e-9bd50aa9763c

                    JSON Structure 

                    Name

                    Mandatory / Optional

                    Type

                    Description

                     

                     

                     

                     

                    name

                    mandatory

                    string

                    Name of the new structure

                     

                     

                     

                     

                    type optional string Type of the new structure (eg: costStructure, specificationStructure)
                    nr will be ignored integer The index of the new structure
                    color optional integer Color of the new structure
                    id will be ignored string(guid) Unique guid of the structure
                    startDate optional string (date) Start date ( depends on type of structure )
                    endDate optional string (date) End date ( depends on type of structure )


                    Optional query parameters  

                    Name Type Default value Description
                    varianttype string (guid) Guid.Empty id of the variant type

                     

                    POST

                     

                    Update the structure
                      Resource: structures/<structure_id>

                      URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id> 

                      Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5

                      JSON Structure

                      Name

                      Mandatory / Optional

                      Type

                      Description

                      parentId

                      optional

                      string(guid)

                      Parent node id of the structure (for the first structure, projectId is the parentId)

                      name

                      optional

                      string

                      Name of the structure

                      description

                      optional

                      string

                      Description of the structure

                      type optional string Type of the structure (eg: costStructure, specificationStructure)
                      nr optional integer The index of the structure
                      color optional integer Color of the structure
                      id will be ignored string(guid) Unique guid of the structure
                       PUT
                       Update the specified structure
                      Headers
                      Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                      Content-Type: application/json
                      
                      JSON
                      {
                        "name": "Updated Structure"
                      }
                      Status
                      Status: 200 OK
                      
                      JSON
                      {
                          "parentId": "622272da-f1ff-45ab-a3f0-c8f1255c80e8",
                          "name": "Updated Structure",
                          "description": "FullLifeCycleTest",
                          "type": "CostStructure",
                          "nr": 1,
                          "color": 0,
                          "id": "179439d6-df16-41cc-bd2c-74d05b7995d5"
                      }

                      Delete the structure

                        Resource: structures/<structure_id> 

                        URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id>

                        Example:https://api-stage.bimplus.net/v2/bimplus/structures/db540336-47a3-426e-b3bf-1e532bfac8ea

                         DELETE
                         Deletes a specified structure.
                        Headers
                        Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                        Content-Type: application/json
                        
                        Status
                        Status: 200 OK
                        

                         

                         

                        Resource: structures/<structure_id>

                        URLhttps://api-stage.bimplus.net/v2/<team_slug>/structures/<structure_id> 

                        Example:https://api-stage.bimplus.net/v2/bimplus/structures/179439d6-df16-41cc-bd2c-74d05b7995d5

                        JSON Structure

                        Name

                        Mandatory / Optional

                        Type

                        Description

                        parentId

                        optional

                        string(guid)

                        Parent node id of the structure (for the first structure, projectId is the parentId)

                        name

                        optional

                        string

                        Name of the structure

                        description

                        optional

                        string

                        Description of the structure

                        type optional string Type of the structure (eg: costStructure, specificationStructure)
                        nr optional integer The index of the structure
                        color optional integer Color of the structure
                        id will be ignored string(guid) Unique guid of the structure

                         

                        Create a new variant type in a project
                          Resource: projects/<project_id>/variants 

                          URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/variants

                          Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants

                          JSON Structure

                          Name

                          Mandatory / Optional

                          Type

                          Description

                          name

                          mandatory

                          string

                          Name of the variant type

                          description

                          optional

                          string

                          Description of the variant type

                          id will be ignored string(guid) Unique guid of the variant type


                           POST
                           Create a new variant type of defined structure(eg: cost structure, specification structure) under a project
                          Headers
                          Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                          Content-Type: application/json
                          
                          JSON
                          {
                              "name": "TestVariant type",
                              "description": "Description of the Test variant type"
                          }
                          Status
                          Status: 201 Created
                          
                          JSON
                          {
                            "name": "TestVariant type",
                            "description": "Description of the Test variant type",
                            "id": "733e429a-e232-4e5d-a41e-9bd50aa9763c"
                          }

                          Get the variant type details
                            Resource: projects/<project_id>/variants/<varianttype_id> 

                            URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/variants/<varianttype_id>

                            Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants/733e429a-e232-4e5d-a41e-9bd50aa9763c 

                             GET
                             Get details of a specified variant type.
                            Headers
                            Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                            Content-Type: application/json
                            
                            Status
                            Status: 200 OK
                            
                            JSON
                            {
                              "name": "TestVariant type",
                              "description": "Description of the Test variant type",
                              "id": "733e429a-e232-4e5d-a41e-9bd50aa9763c"
                            }

                            Get the list of existing variant types in the project

                              Resource: projects/<project_id>/variants

                              URLhttps://api-stage.bimplus.net/v2/<team_slug>/projects/<project_id>/variants

                              Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants 

                               GET
                               Gets the list of existing variant types created in the project.
                              Headers
                              Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                              Content-Type: application/json
                              
                              Status
                              Status: 200 OK
                              
                              JSON
                              [
                                {
                                  "name": "TestVariantType1",
                                  "description": "Description of the Test variant type 1",
                                  "id": "6dc03014-8601-49fd-bae9-ef5b185603b6"
                                },
                                {
                                  "name": "TestVariantType2",
                                  "description": "Description of the Test variant type 2",
                                  "id": "4c1fda6b-7fd9-42a7-a4ae-88eababd3082"
                                },
                                {
                                  "name": "TestVariantType3",
                                  "description": "Description of the Test variant type 3",
                                  "id": "f2cf9b21-c1bb-463d-bbee-a6fbfb5e8b3e"
                                },
                                {
                                  "name": "TestVariantType4",
                                  "description": "Description of the Test variant type 4",
                                  "id": "733e429a-e232-4e5d-a41e-9bd50aa9763c"
                                }
                              ]

                              Update the variant type
                                Resource: projects/<project_id>/variants/<varianttype_id>

                                URLhttps://api-stage.bimplus.net/v2/<team_slug>projects/<project_id>/variants/<varianttype_id>

                                Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants/733e429a-e232-4e5d-a41e-9bd50aa9763c

                                JSON Structure

                                Name

                                Mandatory / Optional

                                Type

                                Description

                                name

                                optional

                                string

                                Name of the variant type

                                description

                                optional

                                string

                                Description of the variant type

                                id will be ignored string(guid) Unique guid of the variant type
                                 PUT
                                 Update the specified variant type
                                Headers
                                Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                                Content-Type: application/json
                                
                                JSON
                                {
                                  "name": "Updated TestVariantType4 name"
                                  "description": "Updated description of the TestVariantType4"
                                }
                                Status
                                Status: 200 OK
                                
                                JSON
                                {
                                    "name": "Updated TestVariantType4 name",
                                    "description": "Updated description of the TestVariant type 4",
                                    "id": "733e429a-e232-4e5d-a41e-9bd50aa9763c"
                                }

                                Delete the variant

                                  Resource: projects/<project_id>/variants/<varianttype_id> 

                                  URLhttps://api-stage.bimplus.net/v2/<team_slug>projects/<project_id>/variants/<varianttype_id>

                                  Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants/733e429a-e232-4e5d-a41e-9bd50aa9763c

                                   DELETE
                                   Deletes a specified variant type.
                                  Headers
                                  Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                                  Content-Type: application/json
                                  
                                  Status
                                  Status: 200 OK
                                  

                                  Copy content of source variant type to target variant type

                                    Resource: projects/<project_id>/variants/<targetvarianttype_id>/copyfrom

                                    URLhttps://api-stage.bimplus.net/v2/<team_slug>projects/<project_id>/variants/<targetvarianttype_id>/copyfrom

                                    Example:https://api-stage.bimplus.net/v2/bimplus/projects/622272da-f1ff-45ab-a3f0-c8f1255c80e8/variants/733e429a-e232-4e5d-a41e-9bd50aa9763c/copyfrom

                                    JSON Structure 

                                    Name

                                    Mandatory / Optional

                                    Type

                                    Description

                                    name

                                    will be ignored

                                    string

                                    Name of the variant type

                                    description

                                    will be ignored

                                    string

                                    Description of the variant type

                                    id mandatory string(guid) Unique guid of the source variant type

                                     

                                    PUT

                                    Updates the specified target variant type with all structure element's assignments of elements from source variant type.
                                    When variant type id is missing will be used internally default variant type (Guid.Empty) as a source variant type

                                    Note:
                                    In case when at least one element is already assigned in target variant type and the same element is also present in source variant type,
                                    such api call will return Conflict response and target variant type will not be updated.

                                    Headers
                                    Authorization: BimPlus 9c1874a62c974dcfa75e0132c423a088
                                    Content-Type: application/json
                                    
                                    JSON
                                    {
                                        "name": "ignored variant type name",
                                        "description": "ignored description of variant type",
                                        "id": "f2cf9b21-c1bb-463d-bbee-a6fbfb5e8b3e"
                                    }
                                    Status
                                    Status: 200 OK
                                    
                                    JSON
                                    {
                                        "name": "Updated TestVariantType4 name",
                                        "description": "Updated description of the TestVariant type 4",
                                        "id": "733e429a-e232-4e5d-a41e-9bd50aa9763c"
                                    }
                                    • No labels