Required role: | REGISUserRole |
POST | /DynamicsCRM/Donation/{guid}/Note |
---|
import Foundation
import ServiceStack
public class CRMDonationNoteRequest : Codable
{
public var guid:String
required public init(){}
}
public class CRMDonationNoteResponse : CRMNoteResponse
{
public var first_name:String
public var last_name:String
required public init(){ super.init() }
private enum CodingKeys : String, CodingKey {
case first_name
case last_name
}
required public init(from decoder: Decoder) throws {
try super.init(from: decoder)
let container = try decoder.container(keyedBy: CodingKeys.self)
first_name = try container.decodeIfPresent(String.self, forKey: .first_name)
last_name = try container.decodeIfPresent(String.self, forKey: .last_name)
}
public override func encode(to encoder: Encoder) throws {
try super.encode(to: encoder)
var container = encoder.container(keyedBy: CodingKeys.self)
if first_name != nil { try container.encode(first_name, forKey: .first_name) }
if last_name != nil { try container.encode(last_name, forKey: .last_name) }
}
}
public class CRMNoteResponse : Codable
{
public var subject:String
public var text:String
public var owner_first_name:String
public var owner_last_name:String
public var file_base64:String
public var filename:String
public var filesize:Int
public var mimetype:String
public var added_date:Date?
required public init(){}
}
Swift CRMDonationNoteRequest 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.
POST /DynamicsCRM/Donation/{guid}/Note HTTP/1.1
Host: data.regent-college.edu
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
guid: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { first_name: String, last_name: String, subject: String, text: String, owner_first_name: String, owner_last_name: String, file_base64: String, filename: String, filesize: 0, mimetype: String, added_date: 0001-01-01 }