Trendsic Platform Service

<back to all web services

ImportPreviewRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/import/{Type}/preview
"use strict";
export class ImportRowResult {
    /** @param {{Line?:number,Action?:string,Field?:string,Message?:string,Summary?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    Line;
    /** @type {string} */
    Action;
    /** @type {string} */
    Field;
    /** @type {string} */
    Message;
    /** @type {string} */
    Summary;
}
export class ImportResult {
    /** @param {{ImportType?:string,FileName?:string,DryRun?:boolean,ImportBatchId?:number,TotalRows?:number,NewRows?:number,UpdatedRows?:number,SkippedRows?:number,ErrorRows?:number,Rows?:ImportRowResult[],ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    ImportType;
    /** @type {string} */
    FileName;
    /** @type {boolean} */
    DryRun;
    /** @type {number} */
    ImportBatchId;
    /** @type {number} */
    TotalRows;
    /** @type {number} */
    NewRows;
    /** @type {number} */
    UpdatedRows;
    /** @type {number} */
    SkippedRows;
    /** @type {number} */
    ErrorRows;
    /** @type {ImportRowResult[]} */
    Rows = [];
    /** @type {ResponseStatus} */
    ResponseStatus;
}
export class ImportPreviewRequest {
    /** @param {{Type?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    Type;
}

JavaScript ImportPreviewRequest 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.

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