| POST | /v4/affiliate-tokens-sets |
|---|
import Foundation
import ServiceStack
// @DataContract
public class PostAffiliateTokensSetRequest : Codable
{
// @DataMember(Name="username")
public var username:String
// @DataMember(Name="affiliatePrograms")
public var affiliatePrograms:[AffiliateProgram]
required public init(){}
}
// @DataContract
public class AffiliateProgram : IAffiliateProgram, Codable
{
// @DataMember(Name="programGuid")
public var programGuid:String
// @DataMember(Name="affiliateTokens")
public var affiliateTokens:[String:String]
required public init(){}
}
// @DataContract
public class PostAffiliateTokensSetResponse : Codable
{
// @DataMember
public var success:Bool
// @DataMember
public var affiliateTokensSetGuid:String
// @DataMember
public var responseStatus:ResponseStatus
required public init(){}
}
Swift PostAffiliateTokensSetRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .json suffix or ?format=json
To embed the response in a jsonp callback, append ?callback=myCallback
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v4/affiliate-tokens-sets HTTP/1.1
Host: affiliation-api-zane.dev.platform.georiot.com
Accept: application/json
Content-Type: application/json
Content-Length: length
{"username":"String","affiliatePrograms":[{"programGuid":"String"}]}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length
{"success":false,"affiliateTokensSetGuid":"00000000000000000000000000000000","responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}