| Requires any of the roles: | Worker, Agent, Administrator |
| GET,OPTIONS | /v1/Dropbox/Contact/{ContactId}/{LoggedInAgentId} |
|---|
import Foundation
import ServiceStack
public class DropboxContactRequest : Codable
{
public var dropbox:[Dropbox] = []
public var contactId:Int
public var loggedInAgentId:Int
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 DropboxContactRequest 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.
GET /v1/Dropbox/Contact/{ContactId}/{LoggedInAgentId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
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-01,
Locked: False,
FileSizeInKB: 0
}
]
}