| POST,OPTIONS | /v1/import/{Type}/preview |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class ImportPreviewRequest
{
public String Type = null;
public String getType() { return Type; }
public ImportPreviewRequest setType(String value) { this.Type = value; return this; }
}
public static class ImportResult
{
public String ImportType = null;
public String FileName = null;
public Boolean DryRun = null;
public Integer ImportBatchId = null;
public Integer TotalRows = null;
public Integer NewRows = null;
public Integer UpdatedRows = null;
public Integer SkippedRows = null;
public Integer ErrorRows = null;
public ArrayList<ImportRowResult> Rows = new ArrayList<ImportRowResult>();
public ResponseStatus ResponseStatus = null;
public String getImportType() { return ImportType; }
public ImportResult setImportType(String value) { this.ImportType = value; return this; }
public String getFileName() { return FileName; }
public ImportResult setFileName(String value) { this.FileName = value; return this; }
public Boolean isDryRun() { return DryRun; }
public ImportResult setDryRun(Boolean value) { this.DryRun = value; return this; }
public Integer getImportBatchId() { return ImportBatchId; }
public ImportResult setImportBatchId(Integer value) { this.ImportBatchId = value; return this; }
public Integer getTotalRows() { return TotalRows; }
public ImportResult setTotalRows(Integer value) { this.TotalRows = value; return this; }
public Integer getNewRows() { return NewRows; }
public ImportResult setNewRows(Integer value) { this.NewRows = value; return this; }
public Integer getUpdatedRows() { return UpdatedRows; }
public ImportResult setUpdatedRows(Integer value) { this.UpdatedRows = value; return this; }
public Integer getSkippedRows() { return SkippedRows; }
public ImportResult setSkippedRows(Integer value) { this.SkippedRows = value; return this; }
public Integer getErrorRows() { return ErrorRows; }
public ImportResult setErrorRows(Integer value) { this.ErrorRows = value; return this; }
public ArrayList<ImportRowResult> getRows() { return Rows; }
public ImportResult setRows(ArrayList<ImportRowResult> value) { this.Rows = value; return this; }
public ResponseStatus getResponseStatus() { return ResponseStatus; }
public ImportResult setResponseStatus(ResponseStatus value) { this.ResponseStatus = value; return this; }
}
public static class ImportRowResult
{
public Integer Line = null;
public String Action = null;
public String Field = null;
public String Message = null;
public String Summary = null;
public Integer getLine() { return Line; }
public ImportRowResult setLine(Integer value) { this.Line = value; return this; }
public String getAction() { return Action; }
public ImportRowResult setAction(String value) { this.Action = value; return this; }
public String getField() { return Field; }
public ImportRowResult setField(String value) { this.Field = value; return this; }
public String getMessage() { return Message; }
public ImportRowResult setMessage(String value) { this.Message = value; return this; }
public String getSummary() { return Summary; }
public ImportRowResult setSummary(String value) { this.Summary = value; return this; }
}
}
Java ImportPreviewRequest DTOs
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.
POST /v1/import/{Type}/preview HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
Type: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
ImportType: String,
FileName: String,
DryRun: False,
ImportBatchId: 0,
TotalRows: 0,
NewRows: 0,
UpdatedRows: 0,
SkippedRows: 0,
ErrorRows: 0,
Rows:
[
{
Line: 0,
Action: String,
Field: String,
Message: String,
Summary: String
}
],
ResponseStatus:
{
ErrorCode: String,
Message: String,
StackTrace: String,
Errors:
[
{
ErrorCode: String,
FieldName: String,
Message: String,
Meta:
{
String: String
}
}
],
Meta:
{
String: String
}
}
}