AffiliationAPI

<back to all web services

PostAffiliateTokensSetRequest

Requires Authentication
The following routes are available for this service:
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 .jsv suffix or ?format=jsv

HTTP + JSV

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: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	username: String,
	affiliatePrograms: 
	[
		{
			programGuid: String
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
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
		}
	}
}