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

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); }
}

TypeScript ImportData DTOs

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

HTTP + XML

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: application/xml
Content-Type: application/xml
Content-Length: length

<ImportData xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.General">
  <ContinueOnError>false</ContinueOnError>
  <EntityType>String</EntityType>
  <ErrorField>String</ErrorField>
  <FixedValues>
    <ImportData.FixedValue>
      <Name>String</Name>
      <Value>String</Value>
    </ImportData.FixedValue>
  </FixedValues>
  <Rows>
    <ImportData.Row>
      <Fields>
        <ImportData.ImportField>
          <Name>String</Name>
          <Value>String</Value>
        </ImportData.ImportField>
      </Fields>
    </ImportData.Row>
  </Rows>
</ImportData>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ImportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.General">
  <ErrorRows>0</ErrorRows>
  <Errors xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>String</d2p1:string>
  </Errors>
  <SuccesfullRows>0</SuccesfullRows>
  <TotalAdded>0</TotalAdded>
  <TotalRows>0</TotalRows>
  <TotalUpdated>0</TotalUpdated>
</ImportResult>