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
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    /**
    * Import entity data into DigiOffice (v1)
    */
    @Api(Description="Import entity data into DigiOffice (v1)")
    public static class ImportData
    {
        /**
        * Entityname in which the data will be imported
        */
        @ApiMember(Description="Entityname in which the data will be imported", IsRequired=true)
        public String EntityType = null;

        /**
        * 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 String ErrorField = null;

        /**
        * Should import continue on errors? (Default true)
        */
        @ApiMember(Description="Should import continue on errors? (Default true)")
        public Boolean ContinueOnError = null;

        /**
        * Rows to be imported
        */
        @ApiMember(Description="Rows to be imported", IsRequired=true)
        public ArrayList<Row> Rows = new ArrayList<Row>();

        /**
        * Additional values to be imported on every row
        */
        @ApiMember(Description="Additional values to be imported on every row")
        public ArrayList<FixedValue> FixedValues = null;
        
        public String getEntityType() { return EntityType; }
        public ImportData setEntityType(String value) { this.EntityType = value; return this; }
        public String getErrorField() { return ErrorField; }
        public ImportData setErrorField(String value) { this.ErrorField = value; return this; }
        public Boolean isContinueOnError() { return ContinueOnError; }
        public ImportData setContinueOnError(Boolean value) { this.ContinueOnError = value; return this; }
        public ArrayList<Row> getRows() { return Rows; }
        public ImportData setRows(ArrayList<Row> value) { this.Rows = value; return this; }
        public ArrayList<FixedValue> getFixedValues() { return FixedValues; }
        public ImportData setFixedValues(ArrayList<FixedValue> value) { this.FixedValues = value; return this; }
    }

    public static class Row
    {
        public ArrayList<ImportField> Fields = null;
        
        public ArrayList<ImportField> getFields() { return Fields; }
        public Row setFields(ArrayList<ImportField> value) { this.Fields = value; return this; }
    }

    public static class ImportField
    {
        public String Name = null;
        public String Value = null;
        
        public String getName() { return Name; }
        public ImportField setName(String value) { this.Name = value; return this; }
        public String getValue() { return Value; }
        public ImportField setValue(String value) { this.Value = value; return this; }
    }

    public static class FixedValue
    {
        public String Name = null;
        public String Value = null;
        
        public String getName() { return Name; }
        public FixedValue setName(String value) { this.Name = value; return this; }
        public String getValue() { return Value; }
        public FixedValue setValue(String value) { this.Value = value; return this; }
    }

    public static class ImportResult
    {
        public Integer TotalRows = null;
        public Integer TotalAdded = null;
        public Integer TotalUpdated = null;
        public Integer SuccesfullRows = null;
        public Integer ErrorRows = null;
        public ArrayList<String> Errors = null;
        
        public Integer getTotalRows() { return TotalRows; }
        public ImportResult setTotalRows(Integer value) { this.TotalRows = value; return this; }
        public Integer getTotalAdded() { return TotalAdded; }
        public ImportResult setTotalAdded(Integer value) { this.TotalAdded = value; return this; }
        public Integer getTotalUpdated() { return TotalUpdated; }
        public ImportResult setTotalUpdated(Integer value) { this.TotalUpdated = value; return this; }
        public Integer getSuccesfullRows() { return SuccesfullRows; }
        public ImportResult setSuccesfullRows(Integer value) { this.SuccesfullRows = value; return this; }
        public Integer getErrorRows() { return ErrorRows; }
        public ImportResult setErrorRows(Integer value) { this.ErrorRows = value; return this; }
        public ArrayList<String> getErrors() { return Errors; }
        public ImportResult setErrors(ArrayList<String> value) { this.Errors = value; return this; }
    }

}

Java 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>