Trendsic Platform Service

<back to all web services

ResourceRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/Resource

export class ResourceCategory
{
    public CategoryName: string;
    public Subcategories: string[] = [];

    public constructor(init?: Partial<ResourceCategory>) { (Object as any).assign(this, init); }
}

export class Document
{
    public DocumentId: string;
    public DocType: string;
    public DocCategory: string;
    public DocSubCategory: string;
    public DocTitle: string;
    public DocDescription: string;
    public DocData: string = [];
    public DocExpiration?: string;
    public DocMimeType: string;
    public DisplayOrder: number;
    public FileSizeInKB: number;
    public Link: string;
    public UploadDate?: string;
    public DocKey: string;

    public constructor(init?: Partial<Document>) { (Object as any).assign(this, init); }
}

export class Resource
{
    public ResourceType: string;
    public Categories: ResourceCategory[] = [];
    public Documents: Document[] = [];

    public constructor(init?: Partial<Resource>) { (Object as any).assign(this, init); }
}

export class ResourceResponse
{
    public ResponseStatus: ResponseStatus;
    public Resource: Resource[] = [];

    public constructor(init?: Partial<ResourceResponse>) { (Object as any).assign(this, init); }
}

export class ResourceRequest
{
    public Resource: Resource[] = [];

    public constructor(init?: Partial<ResourceRequest>) { (Object as any).assign(this, init); }
}

TypeScript ResourceRequest 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/Resource HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Resource: 
	[
		{
			ResourceType: String,
			Categories: 
			[
				{
					CategoryName: String,
					Subcategories: 
					[
						String
					]
				}
			],
			Documents: 
			[
				{
					DocumentId: 00000000000000000000000000000000,
					DocType: String,
					DocCategory: String,
					DocSubCategory: String,
					DocTitle: String,
					DocDescription: String,
					DocData: AA==,
					DocExpiration: 0001-01-01,
					DocMimeType: String,
					DisplayOrder: 0,
					FileSizeInKB: 0,
					Link: String,
					UploadDate: 0001-01-01,
					DocKey: String
				}
			]
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Resource: 
	[
		{
			ResourceType: String,
			Categories: 
			[
				{
					CategoryName: String,
					Subcategories: 
					[
						String
					]
				}
			],
			Documents: 
			[
				{
					DocumentId: 00000000000000000000000000000000,
					DocType: String,
					DocCategory: String,
					DocSubCategory: String,
					DocTitle: String,
					DocDescription: String,
					DocData: AA==,
					DocExpiration: 0001-01-01,
					DocMimeType: String,
					DisplayOrder: 0,
					FileSizeInKB: 0,
					Link: String,
					UploadDate: 0001-01-01,
					DocKey: String
				}
			]
		}
	]
}