BimPoint WebApi Client



Introduction

BimPoint services also provide to our clients a full REST WebApi, which can be viewed https://api.bim-point.com/ ;  We also provide .NET WebApiClient, which can be downloaded from https://www.nuget.org/packages/BimPoint.WebApi.Client/ ;

This documentation describes what is required to use our webapi, how to use most required methods using the WebApiClient;

Before using WebAPI

  • Before using BimPoint WebApi, you need to have an account with us and having projects; If you don't have or  you want a demo, please contact us https://www.bim-point.com/contact ;

  • Once you have an account, you should be able to create account and setup permissions, which limit the scope of what can be done via webapi;

  • You can either generate a Refresh Token for your dev team or for third parties ( Recommended)  or you can provide to them a username and password

You have total control over your data; Developers can do only what you allow them to do via the WebApi; Make sure you setup properly user rights of the user, which will be used in WebApi to avoid any unpleasant surprise

Connecting to WebApi

In order to connect to webapi, you typically need to know

  • Your company Url

  • The Project Url

  • The  provided RefreshToken Or UserName/ Password

  • The WebApi Url

Getting Token using username / password



ServiceConfiguration serviceConfiguration = new ServiceConfiguration { BaseUrl = "https://api.bim-point.com", Application = "MyLovelyApplication" //strongly recommend to provide you application name }; OAuth2Service oAuth2Service = new OAuth2Service(serviceConfiguration ); BpOAuth2TokenRequest tokenRequest = new BpOAuth2TokenRequest { Application = serviceConfiguration.Application, Email = "email@email.com", Password = "password", GrantType = BpOAuth2TokenRequest.GrantTypes.Password }; var tokenResponse = await oAuth2Service.GetTokenAsync(tokenRequest);

The tokenResponse will contain the a refreshtoken, expiration date and also real token

  • Refresh token expires after 3 months

  • The token expires after 1hour

Getting Token using refreshtoken



OAuth2Service oAuth2Service = new OAuth2Service(serviceConfiguration ); BpOAuth2TokenRequest tokenRequest = new BpOAuth2TokenRequest { Application = serviceConfiguration.Application, RefreshToken= "myrefreshtoken", GrantType = BpOAuth2TokenRequest.GrantTypes.RefreshToken}; var tokenResponse = await oAuth2Service.GetTokenAsync(tokenRequest);

Searching for IfcItem

The most probable activity you will be doing is searching for an IfcItem; Before being able to search for ifcitems of a project, you need to understand the structure of each ifcitem.

  • A project is made of one or multiple ifc files https://technical.buildingsmart.org/standards/ifc/

  • Each Ifc File is made of several Objects with different types, which we call in our application : IfcItem

  • Each IfcItem has common properties such as Id, Label, Name , GlobalId and Type.

  • Each IfcItem has a set of various properties;

  • Each property is characterized by Key, Name,  Category and ValueType

  • In BimPoint, Each IfcItem can have two different kinds of  set of properties

    • READONLY properties ; these are properties extracted from Ifc File and their keys start with "pXXXX", ie p2, p3

    • READWRITE properties; these properties are user properties defined by user in our system; their keys start with "upXXXX" i.e up1, up252

To search in BimPoint application, you need to know the key of each property, category and  their valuetype in order to build your queries

Finding IfcItem Property Categories

Before searching, it is good to know all IfcItem Property categories; they don't change very often so you can cache them in your own database.

serviceConfiguration.Token = tokenResponse.Token; var categoryService = new IfcItemPropertyCategoryService(serviceConfiguration, projectUrl); var search = new BpIfcItemPropertyCategorySearch { Take = 50, Skip =0, GetCount = true // this will give the total }; var result = await this.ifcItemPropertyCategoryService.FindAsync(search);

Finding IfcItem Properties

Once you know the categories, you can also find the properties of specific category (optional); Getting properties is important as it will allow you to know the key of each of them



Finding IfcItemUserProperty Categories and Properties

Similar to readonly properties and categories, you can also find the user properties and categories

Finding IfcItems

Once  you know properties, categories , user properties and user property categories, finding IfcItem is easy; The Search object provides great flexibility;

  • Remember, in criterias or properties to be returned, property keys  are either Pxxx or UPXXX

  • We have well known properties keys such as : "name", "label", "globalid", "id", "type"

Example 1 : Find All With Criteria Include Properties By Categories

Example 2:  Find All With Criteria. Include specifics properties, user properties and calculate Sum of some properties number properties



Practical Info

BpIfcItemSearch

Property

Note

Property

Note

GlobalIds

 list of unique identifiers you want to limit the search too

Ids

list of unique ids you want to limit the search to; the ids are internal ids generated by our application; this can change whenever the ifc files are reimport

Labels

internal ids used in the graphical representation in our main applications;

Criterias

List of criterias; all criterias are executed using AND operators

IfcPropertiesOption

Allow you to specific which properties to be included : either you specifically list keys or categories or none of them (which is default)

UserPropertiesOption

Allow you to specific which user properties to be included: either by keys, categories or none

SumUpPropertyKeys

It will calculates the sum of specified keys; only number types

GetCount

if you want us to give you the total count , set this value to true

Take

how many row you want back

Skip

From which number you want the take to start from

SortBy

Expected a property key

OrderBy

asc or desc

BpIfcItemSearchCriteriaOperator

BpIfcItemPropertyOptionInclude

IfcItem Types

The list of ifcitem types are per ifc  specification and it can be found here http://www.buildingsmart-tech.org

User Properties Management

If your permissions allow you, you should be able to create user properties for the project; User properties are grouped by Category and SubCategory; Your permission may allow you to only create user properties of specific categories only; SubCategories can be freely defined and they are used mainly to organize displaying in our main application

To create and query user properties, you need to use IfcItemUserPropertyService

We support many value types. To determine tha value type on row 12, use the term from the following table in the first column. The second column contains a brief description of the value type on the same row.

ValueType

Description

ValueType

Description

string

any string

number

any number

integer

only integer without decimal separator

date

date (in format according to ISO 8601)

url

it is a string which will be displayed in UI as link

list

multiple value string

bool

true/false

email

an email value

user

an id or url of a bimpoint user within your company

Set / Update User Properties Value of IfcItems

User properties of IfcItem ( started with UPxxx) can also be updated via API;  All depends of your permissions; We require the GlobalId as the unique identifier of the each element to be updated;

Update one



Bulk Updates

If you have multiple items to be updated , Bulk is suitable method for you



Contact

If you have any issues using the webapi client, drop an email to devteam@bim-point.com