Trendsic Platform Service

<back to all web services

DropboxCustomerRequest

The following routes are available for this service:
GET,POST,OPTIONS/v1/Dropbox/Customer/{CustomerId}
GET,POST,OPTIONS/v1/Dropbox/Customer/CustomerCheckIn/{CustomerCheckInId}
import Foundation
import ServiceStack

public class DropboxCustomerRequest : Codable
{
    public var dropbox:[Dropbox] = []
    public var customerId:String
    public var customerCheckInId:String

    required public init(){}
}

public class Dropbox : Codable
{
    public var id:Int
    public var attachmentId:String
    public var firstName:String
    public var lastName:String
    public var tableName:String
    public var recordId:Int
    public var Description:String
    public var documentType:String
    public var documentGroup:String
    public var dateAdded:Date
    public var locked:Bool
    public var fileSizeInKB:Double

    required public init(){}
}

public class DropboxResponse : Codable
{
    public var responseStatus:ResponseStatus
    public var dropbox:[DropboxExtended] = []

    required public init(){}
}

public class DropboxExtended : Dropbox
{
    public var attachmentName:String
    public var agentName:String
    public var mimeType:String
    public var isAgent:Bool
    public var isContact:Bool
    public var isShared:Bool
    public var canShare:Bool
    public var shareList:String

    required public init(){ super.init() }

    private enum CodingKeys : String, CodingKey {
        case attachmentName
        case agentName
        case mimeType
        case isAgent
        case isContact
        case isShared
        case canShare
        case shareList
    }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
        let container = try decoder.container(keyedBy: CodingKeys.self)
        attachmentName = try container.decodeIfPresent(String.self, forKey: .attachmentName)
        agentName = try container.decodeIfPresent(String.self, forKey: .agentName)
        mimeType = try container.decodeIfPresent(String.self, forKey: .mimeType)
        isAgent = try container.decodeIfPresent(Bool.self, forKey: .isAgent)
        isContact = try container.decodeIfPresent(Bool.self, forKey: .isContact)
        isShared = try container.decodeIfPresent(Bool.self, forKey: .isShared)
        canShare = try container.decodeIfPresent(Bool.self, forKey: .canShare)
        shareList = try container.decodeIfPresent(String.self, forKey: .shareList)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
        var container = encoder.container(keyedBy: CodingKeys.self)
        if attachmentName != nil { try container.encode(attachmentName, forKey: .attachmentName) }
        if agentName != nil { try container.encode(agentName, forKey: .agentName) }
        if mimeType != nil { try container.encode(mimeType, forKey: .mimeType) }
        if isAgent != nil { try container.encode(isAgent, forKey: .isAgent) }
        if isContact != nil { try container.encode(isContact, forKey: .isContact) }
        if isShared != nil { try container.encode(isShared, forKey: .isShared) }
        if canShare != nil { try container.encode(canShare, forKey: .canShare) }
        if shareList != nil { try container.encode(shareList, forKey: .shareList) }
    }
}


Swift DropboxCustomerRequest 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/Dropbox/Customer/{CustomerId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"Dropbox":[{"Id":0,"AttachmentId":"00000000000000000000000000000000","FirstName":"String","LastName":"String","TableName":"String","RecordId":0,"Description":"String","DocumentType":"String","DocumentGroup":"String","DateAdded":"0001-01-01T00:00:00.0000000","Locked":false,"FileSizeInKB":0}],"CustomerId":"00000000000000000000000000000000","CustomerCheckInId":"00000000000000000000000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"Dropbox":[{"AttachmentName":"String","AgentName":"String","MimeType":"String","IsAgent":false,"IsContact":false,"IsShared":false,"CanShare":false,"ShareList":"String","Id":0,"AttachmentId":"00000000000000000000000000000000","FirstName":"String","LastName":"String","TableName":"String","RecordId":0,"Description":"String","DocumentType":"String","DocumentGroup":"String","DateAdded":"0001-01-01T00:00:00.0000000","Locked":false,"FileSizeInKB":0}]}