Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Integration Service

Data API Software Development Kit

  • Last UpdatedFeb 28, 2025
  • 4 minute read

The AVEVA™ Integration Service Development Kit (SDK) has been provided to enable efficient and consistent use of the Data API. The SDK is available as AVEVA.IntegrationService.DataAPI.SDK.Lib.dll with the installation files.

The Data API SDK can be used by creating an HttpClient to retrieve the data.

Create an HttpClient and pass it as parameter to the method CreateDataApiHttpClient of DataApiHttpClientFactory. The factory method CreateDataApiHttpClient<T> is a generic method that accepts the ProductCategory as type parameter. For example, to create HttpClient for AVEVA Engineering:

var engineeringHttpClient = DataApiHttpClientFactory.CreateDataApiHttpClient<EngineeringHttpClient>(client, host);

The value of host parameter is the URL where the Data API is being hosted.

The following code provides an example of how the Engineering data can be retrieved from the Data API.

var engineeringDataClient = DataApiHttpClientFactory.CreateDataApiHttpClient<EngineeringHttpClient>(client, host);

var engineeringResult = await engineeringDataClient.GetDataSources("");

foreach (var item in engineeringResult)

{

Console.WriteLine($"Engineering Datasource.Name: {item.Name}");

}

To test the health of Data API and Config API HealthCheckHttpClientFactory is available. The following code snippet can be used to check the health of the Data API. The value of the variable host should be the URL where the Data API is hosted. To check the health of Config API pass the value of Config API URL as host.

var baseDataClient = HealthCheckHttpClientFactory.CreateHealthCheckHttpClient(client, host);

var apiHealthCheck = await baseDataClient.HealthCheckAPI(dataAPIHCUrl);

StringBuilder sb = new StringBuilder();

if (apiHealthCheck == System.Net.HttpStatusCode.OK)

{

sb.AppendLine($"The DATA API is up and running.");

}

else

{

sb.AppendLine($"The DATA API is down and the status code is {apiHealthCheck}.");

exitApplication = true;

}

MessageBox.Show(sb.ToString());

if (exitApplication)

{

return;

}

To check the health of the API, the HealthCheckHttpClient is available

Task<HttpStatusCode> HealthCheckAPI(string apiBaseUrl);

To handle the Pub/Sub SignalRPubSubClient is available.

Task<string> Publish(Broadcast publishObject, string host, string topic);

Task<string> Subscribe(string host, string topic);

Task<string> Unsubscribe(string host, string topic);

The following HttpClients are available to fetch data from Data API:

  • EngineeringHttpClient

  • ERMHttpClient

  • ExcelHttpClient

  • OracleHttpClient

  • OthersHttpClient

  • SimulationHttpClient

  • SqlHttpClient

The following common methods are available in all HttpClients to fetch data:

Task<IEnumerable<TDataSource>> GetDataSources(string filter = "");

Task<IEnumerable<KeyValuePair<string, string>>> GetMetaData(string datasourceName);

Task<TDataSource> GetDataSource(string datasourceName, string filter = "");

Task<DataTable> GetTables(string datasourceName, string filter = "", bool liveData = false);

Task<DataTable> GetTableData(string datasourceName, string TableName, string filter = "", bool liveData = false);

Task<DataTable> GetTableSchema(string datasourceName, string TableName, bool liveData = false);

Task<IEnumerable<Acknowledgement>> GetAcknowledgements(string datasourceName);

Task<DataTable> GetTableDataByAcknowledgementId(string datasourceName, string acknowledgementId);

Task<AckMetaData> GetAcknowledgementMetaData(string dataSourceName, string acknowledgementId);

Task<DataTable> GetAcknowledgementDataWithChunkId(string datasourceName, string acknowledgementId, int chunkId);

Task<AcknowledgementResult> PostTables(string datasourceName, List<Table> tables, string AckId, string Context = "", string Topic = "");

Task<AcknowledgementResult> PostTableSchema(string datasourceName, string datatableName, DataTable dataTable, string AckId, string Context = "", string Topic = "");

Task<AcknowledgementResult> PostTableData(string datasourceName, string datatableName, DataTable dataTable, string AckId, string Context = "", string Topic = "");

Task<string> PostMemo(string datasourceName, Acknowledgement memo);

Task<AcknowledgementResult> PostData(string datasourceName, string ackId, object dataTable, string requestPath, string context= "", string topic= "", int sizeofChunk = 5000);

Task<bool> UpdateToken(string token);

Task<DataSet> GetDatasetByAcknowledgementId(string datasourceName, string acknowledgementId);

The following methods are available only in EngineeringHttpClient:

Task<DataTable> GetObjectInfo(string datasourceName, string elementName, bool isLiveData = false);

Task<DataTable> GetObjectInfoAttribute(string datasourceName, string ElementName, string attribute, bool isLiveData = false);

Task<DataSet> GetPublishedTags(string datasourceName, string key, bool isLiveData = false);

Task<AcknowledgementResult> PostObjectInfo(string datasourceName, string Element, string data, string AckId, string Context = "", string Topic = "");

Task<AcknowledgementResult> PostObjectInfoAttribute(string datasourceName, string Element, string Attr, string data, string AckId, string Context = "", string Topic = "");

Task<AcknowledgementResult> PostPublishedTags(string datasourceName, string key, string data , string AckId, string Context = "", string Topic = "");

The following methods are available only in ERMHttpClient

Task<DataTable> GetTableData(string datasourceName, string TableName, string filter = "", bool liveData = false);

Task<DataSet> GetStoredSpecData(string dataSourceName);

Task<AcknowledgementResult> PostSpecData(string dataSourceName,DataSet dataSet, string ackId, string context="", string topic="");

Task<DataSet> GetSpecData(string dataSourceName, string ackId);

The following methods are available only in ETAPHttpClient

Task<DataSet> GetEtapData(string datasourceName,string filter = "", bool isLiveData = false);

Task<DataSet> GetEtapSchema(string datasourceName, bool isLiveData = false);

Task<AcknowledgementResult> PostEtapData(string datasourceName, DataSet data, string AckId, string Context = "", string Topic = "");

Task<AcknowledgementResult> PostEtapSchema(string datasourceName, DataSet data, string AckId, string Context = "", string Topic = "");

The following methods are available only in ExcelHttpClient

Task<IEnumerable<Excel>> GetExcels(string datasourceName, bool liveData=false);

Task<DataSet> GetExcelData(string datasourceName, string excelName, bool liveData = false);

Task<IEnumerable<string>> GetExcelSheetList(string datasourceName, string excelName, bool liveData = false);

Task<DataTable> GetExcelSheetData(string datasourceName, string excelName, string sheetName, string filter, bool liveData = false);

Task<DataSet> GetExcelDataByAcknowledgementId(string datasourceName, string acknowledgementId);

Task<AcknowledgementResult> PostExcelFileList(string datasourceName, DataSet data, string ackId = "", string Context = "", string Topic = "");

Task<AcknowledgementResult> PostExcelSheetList(string datasourceName, string excelFileName, DataSet data, string ackId = "", string Context = "", string Topic = "");

Task<AcknowledgementResult> PostExcelData(string datasourceName, string fileName, DataSet data, string ackId = "", string Context = "", string Topic = "");

Task<AcknowledgementResult> PostExcelSheetData(string datasourceName, string fileName, string sheetName, DataSet data, string ackId = "", string Context = "", string Topic = "");

How to Consume PubSubClient?

PubSubClient is a singleton object, one client connection for the single instance of the application. Once you Instantiate the PubSubClient object it will internally establish the connection to the Hub Server and from there you can directly Publish, Subscribe to any topics that you want to

You must create one delegate event handler to receive the notifications once you make a subscription to the specific topic/datasourcename.

var pubSubClient = await SignalRHubConnectionFactory.CreatePubSubClient(AuthenticationType.NTLM, signalRUri);

pubSubClient.MessagePublished += OnMessagePublished;

public void OnMessagePublished(object source, PubSubMessageEventArgs eventArgs)

{

}

Once you create a client, then you make publish and subscribe requests from the client itself

await pubSubClient.Subscribe(nameToSubscribe);

// nameToSubscribe will be topic which you want to make subscribe to the hub

Publish Message

public static async void PublishNotification(string topic, MessageDto message)

{

try

{

string pubSubUri = // DataAPI Uri

var pubSubClient =await SignalRHubConnectionFactory.CreatePubSubClient(AuthenticationType.NTLM, pubSubUri);

PubSubMessage pubSubMessage = GeneratePubSubMessage(message);

var result = await pubSubClient.Publish(pubSubMessage, topic);

}

catch (Exception ex)

{

}

}

private static PubSubMessage GeneratePubSubMessage(MessageDto message)

{

return new PubSubMessage

{

Topic = //Topic,

Context = // dynamic: Json string of List<KeyValuePair<string,string>> or Dicrionary<string, string>

};

}

Unsubscibe

var result = await pubSubClient.Unsubscribe(dataSourceName); //datasourcename or topic name

SDK Location

The package can be installed by running the command from powershell console
PM> Install-Package AVEVA.IntegrationService.DataAPI.SDK.Lib -version x.x.xx

In This Topic
TitleResults for “How to create a CRG?”Also Available in