| PUT | /api/importdata |
|---|
export class ImportResult
{
public TotalRows: number;
public TotalAdded: number;
public TotalUpdated: number;
public SuccesfullRows: number;
public ErrorRows: number;
public Errors: string[];
public constructor(init?: Partial<ImportResult>) { (Object as any).assign(this, init); }
}
export class ImportField
{
public Name: string;
public Value: string;
public constructor(init?: Partial<ImportField>) { (Object as any).assign(this, init); }
}
export class Row
{
public Fields: ImportField[];
public constructor(init?: Partial<Row>) { (Object as any).assign(this, init); }
}
export class FixedValue
{
public Name: string;
public Value: string;
public constructor(init?: Partial<FixedValue>) { (Object as any).assign(this, init); }
}
/** @description Import entity data into DigiOffice (v1) */
// @Api(Description="Import entity data into DigiOffice (v1)")
export class ImportData
{
/** @description Entityname in which the data will be imported */
// @ApiMember(Description="Entityname in which the data will be imported", IsRequired=true)
public EntityType: string;
/** @description Reports errors with a reference to this field (for example ID) */
// @ApiMember(Description="Reports errors with a reference to this field (for example ID)")
public ErrorField: string;
/** @description Should import continue on errors? (Default true) */
// @ApiMember(Description="Should import continue on errors? (Default true)")
public ContinueOnError: boolean;
/** @description Rows to be imported */
// @ApiMember(Description="Rows to be imported", IsRequired=true)
public Rows: Row[] = [];
/** @description Additional values to be imported on every row */
// @ApiMember(Description="Additional values to be imported on every row")
public FixedValues: FixedValue[];
public constructor(init?: Partial<ImportData>) { (Object as any).assign(this, init); }
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=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
]
}