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
import Foundation
import ServiceStack

public class ImportPreviewRequest : Codable
{
    public var type:String

    required public init(){}
}

public class ImportResult : Codable
{
    public var importType:String
    public var fileName:String
    public var dryRun:Bool
    public var importBatchId:Int
    public var totalRows:Int
    public var newRows:Int
    public var updatedRows:Int
    public var skippedRows:Int
    public var errorRows:Int
    public var rows:[ImportRowResult] = []
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class ImportRowResult : Codable
{
    public var line:Int
    public var action:String
    public var field:String
    public var message:String
    public var summary:String

    required public init(){}
}


Swift ImportPreviewRequest DTOs

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

HTTP + CSV

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/csv
Content-Type: text/csv
Content-Length: length

{"Type":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}}}