Trendsic Platform Service

<back to all web services

ApsViewerTokenRequest

Requires Authentication
Requires any of the roles:Worker, Agent, Administrator
The following routes are available for this service:
GET,OPTIONS/v1/aps/viewer-token
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';

class ApsViewerTokenResponse implements IConvertible
{
    ResponseStatus? ResponseStatus;
    String? AccessToken;
    int? ExpiresIn;

    ApsViewerTokenResponse({this.ResponseStatus,this.AccessToken,this.ExpiresIn});
    ApsViewerTokenResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
        AccessToken = json['AccessToken'];
        ExpiresIn = json['ExpiresIn'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
        'AccessToken': AccessToken,
        'ExpiresIn': ExpiresIn
    };

    getTypeName() => "ApsViewerTokenResponse";
    TypeContext? context = _ctx;
}

class ApsViewerTokenRequest implements IConvertible
{
    ApsViewerTokenRequest();
    ApsViewerTokenRequest.fromJson(Map<String, dynamic> json) : super();
    fromMap(Map<String, dynamic> json) {
        return this;
    }

    Map<String, dynamic> toJson() => {};
    getTypeName() => "ApsViewerTokenRequest";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
    'ApsViewerTokenResponse': TypeInfo(TypeOf.Class, create:() => ApsViewerTokenResponse()),
    'ApsViewerTokenRequest': TypeInfo(TypeOf.Class, create:() => ApsViewerTokenRequest()),
});

Dart ApsViewerTokenRequest 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

HTTP + JSON

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /v1/aps/viewer-token HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"ResponseStatus":{"ErrorCode":"String","Message":"String","StackTrace":"String","Errors":[{"ErrorCode":"String","FieldName":"String","Message":"String","Meta":{"String":"String"}}],"Meta":{"String":"String"}},"AccessToken":"String","ExpiresIn":0}