Getting your data into MarketHype is one of the first things you need to do in order to properly take advantage of the application. Customer data, purchase history and marketing consents are all important to run a successful marketing operation for your organization.

For convenience, MarketHype provides a range of ready-made integrations for data ingestion from external sources. If you want to import data from any of the supported sources, using a ready-made integration is usually the easiest way to go. However, if you want to build your own integration, or import data from other sources, the Data Ingestion API is the way to go.

Import follow up

Importing data to your MarketHype account is an asynchronous operation. Whenever you send data to MarketHype through the JSON API an import process will be started. The import process will do several things with the data you send - validation, normalization, extending it with additional data, mapping it to existing data, indexing it for filtering and segmentation, etc., which might take a few moments. To not leave you waiting, each import process is assigned an ID, which you can use later on to follow up on progress.

With your import process ID, you can call the API to get a complete report for the import process, including current status, success/error count, and a detailed list of any errors that might have occurred within your data.

Let’s say you’ve started a new import process, and the import process was assigned ID 123. To get the current status of that process, you would call the API:

curl -X 'GET' \\  '<https://api.markethype.io/ingestion/v1/imports/123>' \\  -H 'accept: application/json' \\  -H 'X-API-TOKEN: YOUR-API-TOKEN'

The import report is always up to date and will reflect the current status of your import process.

{
	"id": "123",
	"createdAt": "2021-04-26T07:11:41.884Z",
	"status": "FINISHED",
	"successCount": 99,
	"errorCount": 1,
	"errors": [
		{
			"index": 55,
			"code": 1000,
			"message": "Too little information"
		}
	]
}

The import process have three statuses:

Status Description
CREATED We’ve received your data, but have not yet started processing it.
STARTED We are currently processing your data. The report will be updated as we progress.
FINISHED We’ve processed all your data. The report now contain a complete result of success and errors.

The import report will contain a successCount and an errorCount describing how many items were successfully imported and how many contained errors. While we are processing your data - status STARTED, the success and error count will increment as the process progress. When the import process receive status FINISHED that combined success and error count will match the number of items included in your import process.

For any error that occur, a more detailed error report will be included, describing which item caused the error and what the error was.

<aside> <img src="/icons/warning_yellow.svg" alt="/icons/warning_yellow.svg" width="40px" />

NOTICE An imported item that causes an error will be ignored completely during the import process. To import the item, correct the described error and send the correct data as part of a new import process.

</aside>

Input errors

The import report will contain an error object for each item that caused an error.

{
	"index": 55,
	"code": 1000,
	"message": "Too little information"
}

The index field refers to the row number of the erroneous index of the item. The first item in the import process will have index 0, the second item will have index 1 and so on.

The error object will contain an error code and a message describing the error. This is a list of all input error codes the import report may contain.

Code Message Description
1000 Too little information The input contained too little information to create a valid entity.
1001 Invalid custom attribute The input contained unknown custom attribute(s) or the custom attributes were of incorrect type
1002 Invalid values The input contained values that couldn’t be parsed to correct data type.
1003 Invalid values The emails or phone numbers values that are being blocked by specific organization
1004 PackageId referenced an non existing packageItem The input contained an item with packageId but no package was found inside the same order with this id
1005 Ticket bundle referenced an non existing ticket bundle The input contained an item with ticketBundleId but no ticket bundle exist within MarketHype n´or within this Order with that id
1010 No contact found The input referred to an email or phone that does not exist on any contact