Class ExperienceAPIClient
A client for connecting to the xAPI Web service
Namespace: i5.Toolkit.Core.ExperienceAPI
Assembly: cs.temp.dll.dll
Syntax
public class ExperienceAPIClient
Constructors
ExperienceAPIClient()
Creates a new xAPI client with default settings
Declaration
public ExperienceAPIClient()
ExperienceAPIClient(Uri, String, String)
Creates a new xAPI client with the given configuration
Declaration
public ExperienceAPIClient(Uri xApiEndpoint, string authorizationToken, string version)
Parameters
Type | Name | Description |
---|---|---|
Uri | xApiEndpoint | The target URI of the xAPI |
String | authorizationToken | The authorization token to allow the client to access the xAPI |
String | version | The version of the xAPI |
Properties
AuthorizationToken
The authorization token to allow the client to access the xAPI
Declaration
public string AuthorizationToken { get; set; }
Property Value
Type | Description |
---|---|
String |
IsInAdvancedMode
States whether the client operates in advanced mode or standard mode. In advanced mode, more complex statements can be serialized. To enable advanced mode, load the Newtonsoft JSON library for Unity under https://github.com/jilleJr/Newtonsoft.Json-for-Unity.
Declaration
public bool IsInAdvancedMode { get; }
Property Value
Type | Description |
---|---|
Boolean |
Version
The API version. By default 1.0.3
Declaration
public string Version { get; set; }
Property Value
Type | Description |
---|---|
String |
WebConnector
The Web connector that determines how the API is queried
Declaration
public IRestConnector WebConnector { get; set; }
Property Value
Type | Description |
---|---|
IRestConnector |
XApiEndpoint
The target uri where the xAPI can be found
Declaration
public Uri XApiEndpoint { get; set; }
Property Value
Type | Description |
---|---|
Uri |
Methods
SendStatementAsync(Actor, Verb, XApiObject)
Sends a new statement to the xAPI repository Initializes the statement with the given actor, verb and object
Declaration
public Task<WebResponse<string>> SendStatementAsync(Actor actor, Verb verb, XApiObject obj)
Parameters
Type | Name | Description |
---|---|---|
Actor | actor | The actor of the statement |
Verb | verb | The verb of the statement |
XApiObject | obj | The object of the statement |
Returns
Type | Description |
---|---|
Task<WebResponse<String>> | Returns the result of the Web query; if successful, this contains the generated statement id |
SendStatementAsync(Statement)
Sends a new statement to the xAPI repository
Declaration
public Task<WebResponse<string>> SendStatementAsync(Statement statement)
Parameters
Type | Name | Description |
---|---|---|
Statement | statement | The xAPI statement that should be sent |
Returns
Type | Description |
---|---|
Task<WebResponse<String>> | Returns the result of the Web query; if successful, this contains the generated statement id |
SendStatementAsync(String, String, String)
Sends a new statement to the xAPI repository Initializes the statement with the given actor, verb and object ids
Declaration
public Task<WebResponse<string>> SendStatementAsync(string actorMail, string verbUrl, string objectUrl)
Parameters
Type | Name | Description |
---|---|---|
String | actorMail | The mail address of the statement's actor |
String | verbUrl | The id of the statement's verb (should be a url) |
String | objectUrl | The id of the statement's object |
Returns
Type | Description |
---|---|
Task<WebResponse<String>> | Returns the result of the Web query; if successful, this contains the generated statement id |