Show / Hide Table of Contents

Class BaseApi

Base class for any GET API call, or any API call response.

Inheritance
System.Object
BaseApi
BaseApiGet
BaseApiPost
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Appearition.API
Assembly: Appearition.SDK.dll
Syntax
[Serializable]
public abstract class BaseApi

Fields

View Source

Errors

Declaration
public string[] Errors
Field Value
Type Description
System.String[]
View Source

IsSuccess

Declaration
public bool IsSuccess
Field Value
Type Description
System.Boolean

Properties

View Source

ApiVersion

API Version used by this request. Default value is 1.

Declaration
public virtual int ApiVersion { get; }
Property Value
Type Description
System.Int32

The AP i version.

View Source

AuthenticationOverride

Override of the authentication type used for a specific API

Declaration
public virtual AuthenticationOverrideType AuthenticationOverride { get; }
Property Value
Type Description
AuthenticationOverrideType

The type of the authentication override.

View Source

AuthenticationTokenCustomKey

If the authentication override type is set to custom, this value will be used to access the UserProfile authentication token dictionary to fetch the desired value. If none existing, the anonymous token will most likely be used.

Declaration
public virtual string AuthenticationTokenCustomKey { get; }
Property Value
Type Description
System.String
View Source

BypassInternetCheck

Whether this API can bypass the internet connectivity check.

Declaration
public virtual bool BypassInternetCheck { get; }
Property Value
Type Description
System.Boolean
View Source

ChannelIdOverride

Whether or not this specific API requires a certain channel id. If null, will use the one in the Appearition Gate.

Declaration
public virtual int? ChannelIdOverride { get; }
Property Value
Type Description
System.Nullable<System.Int32>
View Source

ExtraRequestUrlHeaders

Provides a template for additional headers that should be included in the API call.

Declaration
protected virtual Dictionary<string, string> ExtraRequestUrlHeaders { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>

The extra URL headers.

View Source

ForcedEndPoint

Whether or not the given request is forced to go to a specific end point instead of the main one.

Declaration
public virtual string ForcedEndPoint { get; }
Property Value
Type Description
System.String
View Source

GetEmsCall

Returns the end point part corresponding to this request. Format: api/RequestCategory/RequestName.

Declaration
public virtual string GetEmsCall { get; }
Property Value
Type Description
System.String

The get EMS call.

View Source

IsBeingUsed

Determines whether this API request object is currently being used or is available. The purpose of this flag is for re-usability of API objects, marking whether this API object can be reused or not.

Declaration
public virtual bool IsBeingUsed { get; set; }
Property Value
Type Description
System.Boolean

true if is being used; otherwise, false.

View Source

JsonReplaceKvp

A dictionary of string to be replaced from one to another. This can be used especially if a key has a name which cannot be used, such as "params", but is required by the EMS.

Declaration
public virtual Dictionary<string, string> JsonReplaceKvp { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>
View Source

OverrideAuthenticationHeader

Whether or not the authentication in the request header should be overrode. If overrode, include your own.

Declaration
public virtual bool OverrideAuthenticationHeader { get; }
Property Value
Type Description
System.Boolean
View Source

RequiresTenant

Whether or not this request should have a tenant as part of the request URL. True by default.

Declaration
public virtual bool RequiresTenant { get; }
Property Value
Type Description
System.Boolean
View Source

ResponseSaveType

How the API should be saved locally for offline capability. In order for the file to be saved, make sure AppearitionConstant.enableApiResponseStorage is true. Lastly, if using a CUSTOM api storage type, override GetCustomOfflineJsonContent and UpdateCustomOfflineJsonContent.

Declaration
public virtual TypeOfApiStorage ResponseSaveType { get; }
Property Value
Type Description
TypeOfApiStorage

Methods

View Source

GetApiCall<T>(String, String, Int32, BaseRequestContent)

Returns the API call of a given class

Declaration
public static string GetApiCall<T>(string source, string tenantName = "", int id = -1, BaseRequestContent requestContent = null)
    where T : BaseApi
Parameters
Type Name Description
System.String source

Source.

System.String tenantName

Tenant name.

System.Int32 id

Identifier.

BaseRequestContent requestContent

Request content.

Returns
Type Description
System.String

The API call.

Type Parameters
Name Description
T

The 1st type parameter.

View Source

GetCustomOfflineJsonContent(Int32, Object, BaseRequestContent)

When the ResponseSaveType is set to Custom, override this method to return a valid json.

Declaration
public virtual string GetCustomOfflineJsonContent(int channelId, object postBodyIfAny, BaseRequestContent requestContentIfAny)
Parameters
Type Name Description
System.Int32 channelId
System.Object postBodyIfAny
BaseRequestContent requestContentIfAny
Returns
Type Description
System.String
View Source

GetJsonFileExtraParams(Object, BaseRequestContent)

Declaration
public virtual string GetJsonFileExtraParams(object postBodyIfAny, BaseRequestContent requestContentIfAny)
Parameters
Type Name Description
System.Object postBodyIfAny
BaseRequestContent requestContentIfAny
Returns
Type Description
System.String
View Source

GetRequestExtraHeaders()

Access the API's additional request headers.

Declaration
public virtual Dictionary<string, string> GetRequestExtraHeaders()
Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>
View Source

ResetToDefault<T>()

Must contain information on how to reset this object to default. This system is made so that

Declaration
public virtual void ResetToDefault<T>()
    where T : BaseApi
Type Parameters
Name Description
T
View Source

UpdateCustomOfflineJsonContent(BaseApi, Int32, Object, BaseRequestContent)

When the ResponseSaveType is set to Custom, override this method to update the local JSOn using live data.

Declaration
public virtual void UpdateCustomOfflineJsonContent(BaseApi api, int channelId, object postBodyIfAny, BaseRequestContent requestContentIfAny)
Parameters
Type Name Description
BaseApi api
System.Int32 channelId
System.Object postBodyIfAny
BaseRequestContent requestContentIfAny

Extension Methods

ObjectExtension.ToStream(Object)
  • View Source
Back to top Generated by DocFX