Zum Hauptinhalt springen

ImportCSV

Class Description

Import data from a CSV File into the contagt api, mapping the columns of the csv onto datafields of room contents.

RPC Configuration

Rpc Name:

Plain: ImportCSV
Sha1: 443784ad872aaed1c4267f74f255b6002cb38463
Rpc Call

RPCs can be called by their plain name or their SHA1 representation.

Rpc Parameters:

"building_id" : int,
"data" : string = ,
"mapping" : array = [],
"index" : int = -1,
"contagt_column" : string = room_id,
"hasTitle" : bool = 1,
"mode" : string = soft
Parameter Description


@param string data the json encoded import data.


@param string[] mapping Maps the fields from the csv to the room content fields [csv => room_content_field]


@param string contagt_column The name of the column that holds the ID on the contagt room content side.


@param bool hasTitle Set to true, if the first row in the csv is a title row and does not contain regular data.


@param string mode Available modes are soft, mixed and hard.

  • Soft: Only data that does not exist within the room content will be filled.
  • Mixed: All data available in the CSV will be wrote into the room content, non existent fields will be left untouched.
  • Hard: All room content will be truncated and the data from the csv will be loaded.

Requires Login:

true

Requires Context:

Context

The context providing parameter can either be a contagt-id (8-Bytes, Alphaumeric) or an integer as a building id. The context parameter name should make the choice obviouse, the type has not to be defined manually.

true

Requires contextParamName:

building_id

Requires WriteAccess:

WriteAccess

Only accounts that have an explicit write access to the defined context can execute this RPC, no matter if the authentication level matches or not.

true

Requires AuthenticationLevel:

Context

Authentication levels allow the SuperUser to define a by-RPC granular access configuration. If RPCs are chained in a single unified call and lenient is enabled, all allowed RPCs will be executed, while execution will fail entirely with lenient set to false.

LOCAL_ADMINISTRATOR

Requires Subbuilding Merge Strategy:

SUBBUILDING_ONLY

Cache Configuration

Response Cache

All writing RPCs are not Cacheable, also Caching will be disabled by the paramters nocache and readonly.

Cache enabled:

false