Watson Marketing Insights Import API Service

Beta

Watson Marketing Insights Import API Service

+ Day(s) remaining in the trial

Overview

After your data file is encrypted locally, then uploaded, use the Import API to move the records from the uploaded profile data file into the WMI database.

The Import service manages data imports into WMI. The service will access data in remote location (initially WMI provisioned tenant Object Storage) and process using Spark to update the customer profile database.

Key characteristics:

  • Data to be imported must already exist in supported storage (Object Store). URI to data in storage provided in request.
  • Imports are long running processes. Initial request initiates the import and subsequent requests obtain status/result.
  • User can specify a single target profile table. Must match an existing table in Profile service (GET /profile) which supports user imports.
  • Supports any input column order via mapping between input schema and target WMI schema.
  • Supports importing a subset of target data structure columns
  • Only MERGE (upsert) import mode is available initially.

Security

Keys

Pick a key to use with this API. Make sure you are logged in with your IBM id for your keys to be populated in the dropdown below. By selecting a key, it will be pre-filled for each endpoint in the Documentation section that can be used with the built-in testing. If you want to change which key to use for a particular endpoint, you can do so at the endpoint in the Documentation section.
You can manage your API keys in the <MyAPIs> section. API keys authenticate you to your subscription, so make sure to keep them secret. Do not share the X-IBM-Client-Secret portion of any API key in publicly accessible places such as GitHub, or client-side code.



Manage your keys
 

Documentation

Watson Marketing Insights Import API Service:

Import

Import
Gets a list of previously requested imports.
Gets a list of previously requested imports.

GET   /import

			https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import
		
Keys
Request code
								
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: APIKey yourapikeyvalue"); headers = curl_slist_append(headers, "accept: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response model

200

A JSON array of import summary object

Body

ImportListResponse

STRING , optional

204

No imports were found

Body

500

Error while retrieving import job details

Body

Response example

200

A JSON array of import summary object

								{
  "ImportListResponse" : string
}
							

204

No imports were found

								
							

500

Error while retrieving import job details

								
							
Gets details for an import.
Gets details for an import.

GET   /import/{id}

			https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import/{id}
		
Keys
Path and Query parameters

id

URL , required

Import id

Request code
								
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET"); curl_easy_setopt(hnd, CURLOPT_URL, "https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import/{id_string}"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: APIKey yourapikeyvalue"); headers = curl_slist_append(headers, "accept: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); CURLcode ret = curl_easy_perform(hnd);
Response model

200

The import status details have been provided.

Body

ImportGetResponse

STRING , optional

ImportGetResponse

OBJECT , optional

status

STRING , required

Latest status of the process

404

The import couldn't be found

Body

500

Couldn't retrieve import details

Body

Response example

200

The import status details have been provided.

								{
  "ImportGetResponse" : string,
  "ImportGetResponse" : {
    "status" : string
  }
}
							

404

The import couldn't be found

								
							

500

Couldn't retrieve import details

								
							
Requests a new import.
Requests a new import.

POST   /import

			https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import
		
Keys
Request code
								
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://wmi-rest-api-r1.watsonmarketinginsights.ibm.com/api/v1/import"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "authorization: APIKey yourapikeyvalue"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "accept: application/json"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"fields\":[null],\"mode\":\"string\",\"newProfiles\":true,\"profile\":\"string\",\"source\":\"string\"}"); CURLcode ret = curl_easy_perform(hnd);
Request model

newProfiles

BOOLEAN , optional

A boolean flag indicating whether the input data includes new profiles or just updates to existing profiles. This flag should be set to 'false' to enhance performance of the import when the data being imported does not include any new profiles to be added to the system. The default value is 'true', indicating that the input data has a mix of new profiles to be added to the system as well as updates to existing profiles.

source

OBJECT , required

The source location of the data to be imported

mode

STRING , required

The method used to apply the input data to the database. 'merge' inserts new records and updates existing records, based on matching keys in the input file. 'truncate' truncates existing data in the specified history profile table and its current profile. 'replace' truncates all existing data and then inserts input data. An empty input file effectively behaves as a truncate (all data deleted, but no data loaded). 'append' inserts data into the table with no attempt to update. Conflicting keys are rejected.

profile

STRING , required

Name of the target profile for the import.

fields

ARRAY , required

A list of fields to be updated in PCA by the import. Fields must be listed in to the order they occur in the source file. To ignore a field in the source file, leave an empty item in the list (e.g. 'field1,field3'). Any additional fields at the end of the record in the source file are ignored.

ImportBase

STRING , optional

The source location of the data to be imported

Request example
[{
  "newProfiles": .test,
  "source": {
    "ImportBase": "undefined"
  },
  "mode": "undefined",
  "profile": "undefined",
  "fields": []
}]
Response model

200

The new import request has been created.

Body

submitted

BOOLEAN , required

Indicates if the import request was successfully posted.

importId

STRING , required

Unique import job id.

statusUrl

STRING , required

URL that can be used to retrieve more information on import status detais.

400

Request couldn't be processed

Body

message

STRING , required

Error explanation

fileError

STRING , required

Error indicating that the specified uri doesn't exist in the Object Storage

missingFields

STRING , required

Error indicating that the supplied array of fields to be imported is empty

validationError

STRING , required

An unknown error occured during the validation.

missingEssentialFields

STRING , required

A list of essential fields that are required to process the import request

invalidMode

STRING , required

Error indicating that the specified mode is not supported by Import Service

invalidFields

STRING , required

A list of specified fields that don't exist in the specified profile

profileNotFound

STRING , required

Error indicating that the specified profile doesn't exist

type

STRING , required

Type of error

406

Import request couldn't be processed (invalid value of Content-Type header)

Body

message

STRING , required

Contents of the message

type

STRING , required

Type of the message

500

Internal Server Error

Body

Response example

200

The new import request has been created.

								{
  "submitted" : boolean,
  "importId" : string,
  "statusUrl" : string
}
							

400

Request couldn't be processed

								{
  "message" : string,
  "fileError" : string,
  "missingFields" : string,
  "validationError" : string,
  "missingEssentialFields" : string,
  "invalidMode" : string,
  "invalidFields" : string,
  "profileNotFound" : string,
  "type" : string
}
							

406

Import request couldn't be processed (invalid value of Content-Type header)

								{
  "message" : string,
  "type" : string
}
							

500

Internal Server Error

								
							

Loading content...