Trendsic Platform Service

<back to all web services

IntegrationsActionRequest

Requires Authentication
The following routes are available for this service:
POST,OPTIONS/v1/integrations/{Provider}/{Action}
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ProviderView:
    key: Optional[str] = None
    name: Optional[str] = None
    category: Optional[str] = None
    blurb: Optional[str] = None
    mono: Optional[str] = None
    auth_mode: Optional[str] = None
    available: bool = False
    status: Optional[str] = None
    health: Optional[str] = None
    status_detail: Optional[str] = None
    account_label: Optional[str] = None
    environment: Optional[str] = None
    last_activity_at: Optional[datetime.datetime] = None
    manage_route: Optional[str] = None
    actions: List[str] = field(default_factory=list)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IntegrationsActionResponse:
    ok: bool = False
    message: Optional[str] = None
    url: Optional[str] = None
    provider: Optional[ProviderView] = None
    response_status: Optional[ResponseStatus] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class IntegrationsActionRequest:
    provider: Optional[str] = None
    action: Optional[str] = None
    api_key: Optional[str] = None
    from_date: Optional[str] = None
    to_date: Optional[str] = None

Python IntegrationsActionRequest 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/integrations/{Provider}/{Action} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Provider: String,
	Action: String,
	ApiKey: String,
	FromDate: String,
	ToDate: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Ok: False,
	Message: String,
	Url: String,
	Provider: 
	{
		Key: String,
		Name: String,
		Category: String,
		Blurb: String,
		Mono: String,
		AuthMode: String,
		Available: False,
		Status: String,
		Health: String,
		StatusDetail: String,
		AccountLabel: String,
		Environment: String,
		LastActivityAt: 0001-01-01,
		ManageRoute: String,
		Actions: 
		[
			String
		]
	},
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}