DigiOffice API Services Services

<back to all web services

ImportData

Import entity data into DigiOffice (v1)

Requires Authentication
The following routes are available for this service:
PUT/api/importdata
"use strict";
export class ImportResult {
    /** @param {{TotalRows?:number,TotalAdded?:number,TotalUpdated?:number,SuccesfullRows?:number,ErrorRows?:number,Errors?:string[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    TotalRows;
    /** @type {number} */
    TotalAdded;
    /** @type {number} */
    TotalUpdated;
    /** @type {number} */
    SuccesfullRows;
    /** @type {number} */
    ErrorRows;
    /** @type {string[]} */
    Errors;
}
export class ImportField {
    /** @param {{Name?:string,Value?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {string} */
    Value;
}
export class Row {
    /** @param {{Fields?:ImportField[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {ImportField[]} */
    Fields;
}
export class FixedValue {
    /** @param {{Name?:string,Value?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Name;
    /** @type {string} */
    Value;
}
export class ImportData {
    /** @param {{EntityType?:string,ErrorField?:string,ContinueOnError?:boolean,Rows?:Row[],FixedValues?:FixedValue[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Entityname in which the data will be imported */
    EntityType;
    /**
     * @type {string}
     * @description Reports errors with a reference to this field (for example ID) */
    ErrorField;
    /**
     * @type {boolean}
     * @description Should import continue on errors? (Default true) */
    ContinueOnError;
    /**
     * @type {Row[]}
     * @description Rows to be imported */
    Rows = [];
    /**
     * @type {FixedValue[]}
     * @description Additional values to be imported on every row */
    FixedValues;
}

JavaScript ImportData DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

PUT /api/importdata HTTP/1.1 
Host: test-do-services.klokgroep.nl 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	EntityType: String,
	ErrorField: String,
	ContinueOnError: False,
	Rows: 
	[
		{
			Fields: 
			[
				{
					Name: String,
					Value: String
				}
			]
		}
	],
	FixedValues: 
	[
		{
			Name: String,
			Value: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	TotalRows: 0,
	TotalAdded: 0,
	TotalUpdated: 0,
	SuccesfullRows: 0,
	ErrorRows: 0,
	Errors: 
	[
		String
	]
}