Trendsic Platform Service

<back to all web services

CustomerThreadPostRequest

The following routes are available for this service:
POST/v1/c/thread/{Kind}/{RefId}
import Foundation
import ServiceStack

public class CustomerThreadPostRequest : Codable
{
    public var kind:String
    public var refId:Int
    public var workerContactId:Int
    public var body:String

    required public init(){}
}

public class CustomerThreadResponse : Codable
{
    public var threads:[JobThreadView] = []
    public var problemReasons:[ProblemReasonView] = []
    public var message:String
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class JobThreadView : Codable
{
    public var id:Int
    public var kind:String
    public var refId:Int
    public var refCode:String
    public var workerContactId:Int
    public var who:String
    public var closed:Bool
    public var closesLocal:String
    public var unread:Int
    public var note:String
    public var quickReplies:[String] = []
    public var messages:[JobThreadMessageView] = []

    required public init(){}
}

public class JobThreadMessageView : Codable
{
    public var id:Int
    public var party:String
    public var mine:Bool
    public var who:String
    public var body:String
    public var viaVoice:Bool
    public var isStatusChip:Bool
    public var chipKey:String
    public var sentUtc:Date
    public var sentLocal:String
    public var seen:Bool

    required public init(){}
}

public class ProblemReasonView : Codable
{
    public var key:String
    public var label:String

    required public init(){}
}


Swift CustomerThreadPostRequest 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 /v1/c/thread/{Kind}/{RefId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Kind: String,
	RefId: 0,
	WorkerContactId: 0,
	Body: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Threads: 
	[
		{
			Id: 0,
			Kind: String,
			RefId: 0,
			RefCode: String,
			WorkerContactId: 0,
			Who: String,
			Closed: False,
			ClosesLocal: String,
			Unread: 0,
			Note: String,
			QuickReplies: 
			[
				String
			],
			Messages: 
			[
				{
					Id: 0,
					Party: String,
					Mine: False,
					Who: String,
					Body: String,
					ViaVoice: False,
					IsStatusChip: False,
					ChipKey: String,
					SentUtc: 0001-01-01,
					SentLocal: String,
					Seen: False
				}
			]
		}
	],
	ProblemReasons: 
	[
		{
			Key: String,
			Label: String
		}
	],
	Message: String,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}