Back
New article

Push data to Blue using API functions

To import data sources into Blue, the following API calls are required to push all types of data :

  • GetDataSourceList()
  • GetDataBlockInformation()
  • RegisterImport()
  • PushObjectDataV2()
  • PrepareDataToFinalizeImportV2()
  • FinalizeImport()
  • CancelImport()
IMPORTANT
  • There is no strict size limit for batch imports via the Blue API. However, the recommended size is 1,000 records per batch. Large datasets (e.g., 2 GB) may take longer to process.
  • Data handling depends on Blue’s best practices, including:
    • Data source configuration (import mode, update, or overwrite)
    • Volume of data
    • Data retention settings
  • Blue processes only one data source at a time. It's advised to schedule imports 10–15 minutes apart to ensure proper queuing.
  • The order of imports is critical. Related data sources (e.g., users and courses) must be imported before relationship data sources.

Overview of Web Service Methods in Blue

  1. GetDataSourceList() - Retrieves the ID of the data source where data will be stored.
  2. GetDataBlockInformation() - Retrieves the block name from the specified data source.
  3. RegisterImport() - Starts the import process and returns a transaction ID.
  4. PushObjectDataV2() - Creates and pushes the data into the data source.
  5. PrepareDataToFinalizeImportV2() - Prepares and validates the data before finalizing the import.
  6. FinalizeImport() - Completes the import process.
  7. CancelImport() - Cancels the current import. It can be executed anytime before calling FinalizeImport().
NOTE
  1. Blue's web services use the SOAP API.
  2. WSHttpBinding is required. For custom bindings, the Blue WSHttpBinding configuration can be requested by contacting support@explorance.com.
  3. An API key must be generated to use Blue's web services:
    • Log into Blue as a System Administrator.
    • Navigate to Connections > API Key.
    • Generate and request the key from your Blue administrator
  4. Data sources must be manually created and imported in Blue beforehand. The data structure must match what is used via the API. The API cannot be used to modify an existing data source schema (e.g., adding or removing fields). Schema validation must be performed by the Blue administrator before pushing data.
  5. If a data source is configured in Blue to override or update (wipe out or append) existing data, the API will follow the same behavior. Refer to the Explorance Help Center or consult the Blue administrator for more details.
  6. These APIs support extension blocks as well. Extension blocks must be pre-created in Blue and follow the same import sequence as standard data sources.

Web Service Endpoints

API structure follows this format:

These URLs are for reference only. Please contact your Blue administrator or the Explorance support team for the correct endpoints.

NOTE

The examples in this document use Python and C# to show how the Blue APIs can be implemented. However, these are only sample languages—the APIs can be used with any programming language that supports basic web requests. The code samples and installation steps are intended to illustrate the general approach to integration.

Prerequisites for Python

Ensure the requests library is installed in your Python environment:

pip install requests

Example: Pushing a Relational Data Source

If Blue cannot directly connect to the database, APIs can serve as a standalone intermediary to extract and push data. The following C# sample code assumes a service reference with the name srvRefImport has been added into the project. The srvRefImport Class refers to BlueWebService.svc endpoint.
Error handling and verification can be added for web service responses. Let's first create an API Key function, to call it as many times as needed.

C# sample code:

public static string ApiKey()
{
   string APIkey = "00000000-0000-0000-0000-000000000000";
   return APIkey;
}

Python Sample code:

api_key = "00000000-0000-0000-0000-000000000000"

1. GetDataSourceList()

The GetDataSourceList() function must be called to retrieve the ID of the "CourseStudents" data source. This ID is returned in the SourceID parameter (e.g., "Data4").

2. GetDataBlockInformation()

This step gets the name(s) of the block(s) associated with the specified data source.

3. RegisterImport()

This function initiates an import transaction. It requires the ID of the "CourseStudents" data source to be passed as a parameter.

4. PushObjectDataV2(), PrepareDataToFinalizeImportV2(), and FinalizeImport()

Once the transaction has started, the PushObjectDataV2() function is used to push data into the system.

Import Status Messages

Each function returns status messages indicating the current state of the import process:

  • RegisterImport()
    • Status -4: This status is returned immediately after the function is executed.
  • PushObjectDataV2()
    • Status -3: Indicates that the import was manually cancelled (e.g., by calling CancelImport()).
    • Status -2: Indicates that the import was automatically cancelled by the API or failed after calling FinalizeImport().
    • Status 0–99: Indicates that the data push is in progress. The import must be finalized using FinalizeImport() for the status to become 100.

If the import is not completed, finalized, or cancelled, no subsequent pushes will be accepted.

Recommendations

GetCurrentImportingDataSourceProcess - This function retrieves the current progress status of an ongoing import and determines whether CancelImport() should be called.
It accepts the following four parameters:

  • API Key (required)
  • String (output message)
  • Int (output progress status)
  • Long (output transaction ID)

Upon execution, the function returns the current TransactionID, which can be used with CancelImport() if the data push needs to be interrupted. Cancelling will terminate the entire import.

The progressStatus value indicates how far along the import is (e.g., 50%).

  • If progressStatus < 0 (e.g., -1, -2, or -3): The transaction has already been cancelled or flushed. No further action is needed.
  • If progressStatus > 0 (e.g., 1–99): If the import fails, CancelImport() should be called to reset the process and generate a new transaction ID.

Error Messages

The web service methods generate messages that indicate whether or not they are successful. Specifically, each web function returns two strings, called Message and APIKeyHeader:

  • When the web function is successful, the Message will be “Success”.
  • When the web function is unsuccessful, Message will contain an error message.
  • When the API key is valid, APIKeyHeader will be “Valid API_KEY“.
  • When the API key is invalid, APIKeyHeader will be “Invalid API_KEY”.

The following table lists the possible messages (including error messages) that the web functions can generate:

Error MessagesDescription
ExecuteImport() returns the message “Row 0 (content of the field): Missing value on COLUMN_NAME field.”The column names and/or types do not match the Blue datasource.
RegisterImport() returns the message “Import registration failed. The datasource is currently being imported by another process.”Another datasource is being imported. Blue can only import one datasource at a time.
Any method returns the APIKeyHeader “Invalid API_KEY”The API key is invalid.
ExecuteImport()or FinalizeImport() returns the Message “Transaction cannot be found.”The Transaction ID is invalid
RegisterImport() returns the Message “datasource does not exist”The datasource ID could not be found.
ExecuteImport() returns the Message “ Some ID's are not unique in table PrimaryUserTable_DataXX_tmp.” (where XX is a number)Some of the data had duplicate IDs.
ExecuteDataFileImport() returns the Message “Message = Row X: Missing value on COLUMN_NAME field.” (where X is a row number)The CSV file is empty.
Any function returns the Message “Cannot connect to the database for Blue application.”The web service could not connect to the Blue database. Please contact Customer Support for assistance.
INVALID_APIKEYThe API key passed to the web service is invalid.
IP_ADDR_DENIEDThe request is invalid: IP address denied
Transaction cannot be foundThe input TransactionID isn't valid and cannot find the transaction
Failed to initialize the datasourceFailed to instantiate the importing datasource.
Could not find the data block '{0}'Failed to instantiate the a data block of importing datasource
Missing required data block table '{0}'.When the required data block table is not created, the required data block table must be created by calling web service "PushObjectDataV2" or "PushStreamDataV2" in order to proceed in the web service function "PrepareDataToFinzalizeImportV2".
Missing primary data block table.When the primary data block table is not created, the primary data block table must be created by calling web service "PushObjectDataV2" or "PushStreamDataV2" in order to proceed in the web service function "PrepareDataToFinzalizeImportV2".
Operation is aborted because the imported data table is empty.When the synchronization option is "True" and the data table before finalize is empty, then the whole process will be aborted and return this message.
Some IDs are not unique in table {0}.In any datasource, if the importing data has duplicated IDs, it returns this message.
Unknown error during batch import: {0}Error message caught while inserting data into table.

List of Warnings

Row {0}: Indicates the specific entry where the problem occurs.

Warning MessagesDescription
Row {0}: '{1}' contains data that exceeds the maximum allowable length of field: Row {0} was not imported.For the ID field (primary), we don't allow data truncate if data exceeds the maximum allowable length.
Row {0}: '{1}' contains data that exceeds maximum allowable length of field: Blue automatically truncated the data.For the field which is not ID field (primary), Blue will automatically truncate the data (it won't invalidate the corresponding record)
Row {0}: '{1}' field contains invalid data, THIS ROW SKIPPED.Data failed to be validated.
Row {0}: Missing ID on {1} field.ID field shouldn't be empty.
Row {0}: ID field contains apostrophe(s).Apostrophe is invalid character in ID field
Row {0}: ID field contains comma(s).Comma is invalid character in ID field
Row {0}: ID field contains ','.',' is invalid character in ID field
Row {0}: ID field contains '||||||'.''||||||'' is invalid character in ID field

SOAP samples

The samples of each of the functions that are described in this document are given below.

Back to top

Copyright © 2025

Explorance Inc. All rights reserved.