Madaster.API - the C# library for the Madaster Private API

The Madaster Private API endpoint.

This C# SDK is automatically generated by the Swagger Codegen project:

  • API version: 1.1
  • SDK version: 1.0.0
  • Build package: io.swagger.codegen.languages.CSharpClientCodegen For more information, please visit https://www.madaster.com

Frameworks supported

  • .NET 4.0 or later
  • Windows Phone 7.1 (Mango)

Dependencies

The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:

Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes

NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742

Installation

Run the following command to generate the DLL

  • [Mac/Linux] /bin/sh build.sh
  • [Windows] build.bat

Then include the DLL (under the bin folder) in the C# project, and use the namespaces:

using Madaster.API.Api;
using Madaster.API.Client;
using Madaster.API.Model;

Packaging

A .nuspec is included with the project. You can follow the Nuget quickstart to create and publish packages.

This .nuspec uses placeholders from the .csproj, so build the .csproj directly:

nuget pack -Build -OutputDirectory out Madaster.API.csproj

Then, publish to a local feed or other host and consume the new package via Nuget as usual.

Getting Started

using System;
using System.Diagnostics;
using Madaster.API.Api;
using Madaster.API.Client;
using Madaster.API.Model;

namespace Example
{
    public class Example
    {
        public void main()
        {

            // Configure API key authorization: Token
            Configuration.Default.ApiKey.Add("X-API-Key", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.ApiKeyPrefix.Add("X-API-Key", "Bearer");

            var apiInstance = new BuildingApi();
            var id = new Guid?(); // Guid? | The identifier of the building.

            try
            {
                // Gets the circular information of a building.
                string result = apiInstance.ApiV11BuildingsByIdCircularGet(id);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling BuildingApi.ApiV11BuildingsByIdCircularGet: " + e.Message );
            }

        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://localhost

Class Method HTTP request Description
BuildingApi ApiV11BuildingsByIdCircularGet GET /api/v1.1/buildings/{id}/circular Gets the circular information of a building.
BuildingApi ApiV11BuildingsByIdDelete DELETE /api/v1.1/buildings/{id} Deletes the building and all related data.
BuildingApi ApiV11BuildingsByIdExportexcelpassportPost POST /api/v1.1/buildings/{id}/exportexcelpassport Schedules the generation of a PDF building passport.
BuildingApi ApiV11BuildingsByIdExportpassportPost POST /api/v1.1/buildings/{id}/exportpassport Schedules the generation of a PDF building passport.
BuildingApi ApiV11BuildingsByIdFinancialGet GET /api/v1.1/buildings/{id}/financial Gets the financial information of a building.
BuildingApi ApiV11BuildingsByIdGet GET /api/v1.1/buildings/{id} Gets a building by its identifier.
BuildingApi ApiV11BuildingsByIdImagesPost POST /api/v1.1/buildings/{id}/images Adds an image to a building.
BuildingApi ApiV11BuildingsByIdProcessPost POST /api/v1.1/buildings/{id}/process Schedules the building for proccesing, recalculates all data.
BuildingApi ApiV11BuildingsByIdPut PUT /api/v1.1/buildings/{id} Replaces a building.
BuildingApi ApiV11BuildingsByIdUsersGet GET /api/v1.1/buildings/{id}/users Gets all users for a building.
BuildingApi ApiV11BuildingsByIdUsersPut PUT /api/v1.1/buildings/{id}/users Replaces the security of a users for a building.
BuildingApi ApiV11BuildingsByIdValidateGet GET /api/v1.1/buildings/{id}/validate Gets building validation parameters.
BuildingApi ApiV11BuildingsGet GET /api/v1.1/buildings Gets all buildings.
BuildingApi ApiV11BuildingsPost POST /api/v1.1/buildings Adds a building.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdActivePost POST /api/v1.1/buildings/{buildingId}/files/{id}/active Activates or deactivates a building file.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdDelete DELETE /api/v1.1/buildings/{buildingId}/files/{id} Deletes a building file.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdDownloadGet GET /api/v1.1/buildings/{buildingId}/files/{id}/download Gets a download url for the building file.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdGet GET /api/v1.1/buildings/{buildingId}/files/{id} Gets a building file by its identifier.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdSetimportingPost POST /api/v1.1/buildings/{buildingId}/files/{id}/setimporting Sets the status of a file to ‘importing’, so element can be added or updated can be made.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdStartrefinementPost POST /api/v1.1/buildings/{buildingId}/files/{id}/startrefinement Starts the refinement of a building file.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdStatusGet GET /api/v1.1/buildings/{buildingId}/files/{id}/status Gets a building file status by its identifier.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesByIdUploadPost POST /api/v1.1/buildings/{buildingId}/files/{id}/upload Uploads a building file.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesGet GET /api/v1.1/buildings/{buildingId}/files Gets all building files.
BuildingFileApi ApiV11BuildingsByBuildingIdFilesPost POST /api/v1.1/buildings/{buildingId}/files Adds a building file.
BuildingFileElementApi ApiV11BuildingsByBuildingIdFilesByFileIdElementsByIdDelete DELETE /api/v1.1/buildings/{buildingId}/files/{fileId}/elements/{id} Deletes an existing building file element.
BuildingFileElementApi ApiV11BuildingsByBuildingIdFilesByFileIdElementsByIdGet GET /api/v1.1/buildings/{buildingId}/files/{fileId}/elements/{id} Gets a building file element by its identifier and building file identifier.
BuildingFileElementApi ApiV11BuildingsByBuildingIdFilesByFileIdElementsByIdPut PUT /api/v1.1/buildings/{buildingId}/files/{fileId}/elements/{id} Updates an existing building file element.
BuildingFileElementApi ApiV11BuildingsByBuildingIdFilesByFileIdElementsGet GET /api/v1.1/buildings/{buildingId}/files/{fileId}/elements Gets a building file elements by its building file identifier.
BuildingFileElementApi ApiV11BuildingsByBuildingIdFilesByFileIdElementsPost POST /api/v1.1/buildings/{buildingId}/files/{fileId}/elements Create a new building file element.
MaterialApi ApiV11MaterialsByIdFinancialvaluesGet GET /api/v1.1/materials/{id}/financialvalues Gets the financial values of a material, for manual import mode.
MaterialApi ApiV11MaterialsByIdFinancialvaluesPost POST /api/v1.1/materials/{id}/financialvalues Adds a financial value for a material, for manual import mode.
MaterialApi ApiV11MaterialsByIdFinancialvaluesPut PUT /api/v1.1/materials/{id}/financialvalues Replaces the financial values for a material, for manual import mode.
MaterialApi ApiV11MaterialsByIdGet GET /api/v1.1/materials/{id} Gets a material by its identifier.
MaterialApi ApiV11MaterialsByIdMatchesGet GET /api/v1.1/materials/{id}/matches Gets the matches of a material.
MaterialApi ApiV11MaterialsByIdMatchesPost POST /api/v1.1/materials/{id}/matches Adds a match for a material.
MaterialApi ApiV11MaterialsByIdMatchesPut PUT /api/v1.1/materials/{id}/matches Replaces the matches for a material.
MaterialApi ApiV11MaterialsByIdPut PUT /api/v1.1/materials/{id} Replaces a material.
MaterialApi ApiV11MaterialsGet GET /api/v1.1/materials Gets all materials.
MaterialApi ApiV11MaterialsPost POST /api/v1.1/materials Adds a material.
PortfolioApi ApiV11PortfoliosByIdBuildingsGet GET /api/v1.1/portfolios/{id}/buildings Gets all buildings for a portfolio.
PortfolioApi ApiV11PortfoliosByIdDelete DELETE /api/v1.1/portfolios/{id} Deletes a portfolio.
PortfolioApi ApiV11PortfoliosByIdGet GET /api/v1.1/portfolios/{id} Gets a portfolio by its identifier.
PortfolioApi ApiV11PortfoliosByIdLogoPost POST /api/v1.1/portfolios/{id}/logo Sets the logo of a portfolio.
PortfolioApi ApiV11PortfoliosByIdPassportPost POST /api/v1.1/portfolios/{id}/passport Schedules the generation of a PDF portfolio passport.
PortfolioApi ApiV11PortfoliosByIdPut PUT /api/v1.1/portfolios/{id} Replaces a portfolio.
PortfolioApi ApiV11PortfoliosByIdUsersGet GET /api/v1.1/portfolios/{id}/users Gets all users for a portfolio.
PortfolioApi ApiV11PortfoliosByIdUsersPut PUT /api/v1.1/portfolios/{id}/users Replaces the security of a users for a portfolio.
PortfolioApi ApiV11PortfoliosGet GET /api/v1.1/portfolios Gets all portfolios.
PortfolioApi ApiV11PortfoliosPost POST /api/v1.1/portfolios Adds a portfolio.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesByIdDelete DELETE /api/v1.1/portfolios/{portfolioId}/files/{id} Deletes a portfolio file.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesByIdDownloadGet GET /api/v1.1/portfolios/{portfolioId}/files/{id}/download Gets a download url for the portfolio file.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesByIdGet GET /api/v1.1/portfolios/{portfolioId}/files/{id} Gets a portfolio file by its identifier.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesByIdStatusGet GET /api/v1.1/portfolios/{portfolioId}/files/{id}/status Gets a portfolio file status by its identifier.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesByIdUploadPost POST /api/v1.1/portfolios/{portfolioId}/files/{id}/upload Uploads a portfolio file.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesGet GET /api/v1.1/portfolios/{portfolioId}/files Gets all portfolio files for a portfolio.
PortfolioFileApi ApiV11PortfoliosByPortfolioIdFilesPost POST /api/v1.1/portfolios/{portfolioId}/files Adds a portfolio file.
ProductApi ApiV11ProductsByIdChildrenGet GET /api/v1.1/products/{id}/children Gets the children of a product.
ProductApi ApiV11ProductsByIdChildrenPost POST /api/v1.1/products/{id}/children Adds a child for a product.
ProductApi ApiV11ProductsByIdChildrenPut PUT /api/v1.1/products/{id}/children Replaces the children for a product.
ProductApi ApiV11ProductsByIdFinancialvaluesGet GET /api/v1.1/products/{id}/financialvalues Gets the financial values of a product.
ProductApi ApiV11ProductsByIdFinancialvaluesPost POST /api/v1.1/products/{id}/financialvalues Adds a financial value for a product.
ProductApi ApiV11ProductsByIdFinancialvaluesPut PUT /api/v1.1/products/{id}/financialvalues Replaces the financial values for a product.
ProductApi ApiV11ProductsByIdGet GET /api/v1.1/products/{id} Gets a product by its identifier.
ProductApi ApiV11ProductsByIdMatchesGet GET /api/v1.1/products/{id}/matches Gets the matches of a product.
ProductApi ApiV11ProductsByIdMatchesPost POST /api/v1.1/products/{id}/matches Adds a match for a product.
ProductApi ApiV11ProductsByIdMatchesPut PUT /api/v1.1/products/{id}/matches Replaces the matches for a product.
ProductApi ApiV11ProductsByIdPut PUT /api/v1.1/products/{id} Replaces a product.
ProductApi ApiV11ProductsGet GET /api/v1.1/products Gets all products.
ProductApi ApiV11ProductsPost POST /api/v1.1/products Adds a product.

Documentation for Models

Documentation for Authorization

Token

  • Type: API key
  • API key parameter name: X-API-Key
  • Location: HTTP header