| Requires any of the roles: | Agent, Administrator |
| GET,OPTIONS | /v1/Dropbox/DocumentGroups/{ContactId} | ||
|---|---|---|---|
| GET,OPTIONS | /v1/Dropbox/DocumentGroups/Agent/{AgentId} |
import Foundation
import ServiceStack
public class DropboxDocumentGroupRequest : Codable
{
public var dropbox:[Dropbox] = []
public var contactId:Int
public var agentId: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 DropboxDocumentGroupRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v1/Dropbox/DocumentGroups/{ContactId} HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<DropboxResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<Dropbox>
<DropboxExtended>
<AttachmentId>00000000-0000-0000-0000-000000000000</AttachmentId>
<DateAdded>0001-01-01T00:00:00</DateAdded>
<Description>String</Description>
<DocumentGroup>String</DocumentGroup>
<DocumentType>String</DocumentType>
<FileSizeInKB>0</FileSizeInKB>
<FirstName>String</FirstName>
<Id>0</Id>
<LastName>String</LastName>
<Locked>false</Locked>
<RecordId>0</RecordId>
<TableName>String</TableName>
<AgentName>String</AgentName>
<AttachmentName>String</AttachmentName>
<CanShare>false</CanShare>
<IsAgent>false</IsAgent>
<IsContact>false</IsContact>
<IsShared>false</IsShared>
<MimeType>String</MimeType>
<ShareList>String</ShareList>
</DropboxExtended>
</Dropbox>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</DropboxResponse>