Reference 360 > Reference 360 REST API > import version 1
  

import version 1

Use this resource to import code values and value mappings, retrieve the status of an import job, and retrieve the detailed report for a failed import job.

Import code values

Imports code values into a code list.
Note: Validation checks are not performed when you import code values.

POST request

To import code values into a code list, submit a POST request with the following URI:
/rdm-service/external/v1/import
The request contains form-data with the following parameters:
file
Specify a CSV file that contains the code value attributes. The columns specified depend on your data model. The CSV must start with two header rows, followed by the data rows.
For example, you might have the following code values:
Name,Code
Name,Code
Afghanistan,AFG
Aland Islands,ALA
Albania,ALB
Algeria,DZA
American Samoa,ASM
Note: You can provide additional information about a code value. For example, you might want to assign a code value to the Approved status. In the status.key column for the code value, enter the key value for the system reference data value that you want to assign. For more information about your configured system reference data values, see Get system reference data values.
importSettings
Specify the file specific configuration and container details.
The importSettings parameter includes the following attributes:
Field
Type
Description
delimiter
String
Delimiter used to separate values. Value must be ASTERISK, CIRCUMFLEX, COLON, COMMA, PIPE, SECTION, SEMICOLON, SPACE, or TAB.
textQualifier
String
Symbol used to indicate where a text begins and ends. Value must be DOUBLE_QUOTE, SINGLE_QUOTE, or NO_QUOTE.
codepage
String
Code page used for the export file. Value must be UTF8.
dateFormat
String
Format used for dates. Use one of the following formats:
  • - DE. For dd.mm.yyyy format.
  • - ISO. For yyyy-mm-dd format.
  • - US. For mm/dd/yyyy format.
containerType
String
Type of asset that contains code values. Value must be codelist.
containerId
String
The ID of the code list to which you want to import code values.
Note: You can find the ID of assets in Reference 360 or use REST APIs to retrieve the IDs. For more information, see Asset IDs.
startingRow
String
Line number from which to start importing data. By default, all rows are imported.

POST response

The response contains the details of the import job.
The response contains the following attributes:
Field
Type
Description
jobId
String
ID of the job.
state
String
Status of the job. Values are CREATED, INPROGRESS, COMPLETED, SUSPENDED, FAILED, STOPPED, QUEUED or WARNING.
startTime
Number
Time, in milliseconds, when the job started.
numOfRecordsProcessed
Number
Number of records processed.
numOfRecordsFailed
Number
Number of records that failed to be imported.
numOfRecordsSucceeded
Number
Number of records successfully imported.

POST example

To import code values, you might use the following request:
POST https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=import-code-values.csv

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=importSettings
Content-Type: application/json;charset=UTF-8

{
"delimiter":"COMMA",
"textQualifier":"DOUBLE_QUOTE",
"codepage":"UTF8",
"dateFormat":"ISO",
"containerType":"CODELIST",
"containerId":"9ab3201990a54dcdc86f54cf",
"startingRow":null
}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
The CSV file might contain the following header rows and data rows:
Name,Code
Name,Code
Afghanistan,AFG
Aland Islands,ALA
Albania,ALB
Algeria,DZA
American Samoa,ASM
The following sample response shows the status of the import job:
{
"jobId":"dd1b2018cb47cef99f8d0f42",
"state":"INPROGRESS",
"startTime":1561367377428,
"numOfRecordsProcessed":100,
"numOfRecordsFailed":25,
"numOfRecordsSucceeded":75
}

Import value mappings

Imports value mappings into a crosswalk.

POST request

To import value mappings into a crosswalk, submit a POST request with the following URI:
/rdm-service/external/v1/import
The request contains form-data with two parameters:
file
Specify a CSV file that contains the code value attributes. The columns specified depend on your data model. The CSV starts with two header rows, followed by the data rows.
For example, you might have the following code values:
sourcePKey,_from.id.sourcePKey,_to.id.sourcePKey
sourcePKey,_from.id.sourcePKey,_to.id.sourcePKey
AF_AFG,AF,AFG
AL_ALA,AL,ALA
ALB_ALB,ALB,ALB
DZ_DZA,DZ,DZA
AS_ASM,AS,ASM
importSettings
Specify the file specific configuration and container details.
The importSettings includes the following attributes:
Field
Type
Description
delimiter
String
Delimiter used to separate values. Value must be ASTERISK, CIRCUMFLEX, COLON, COMMA, PIPE, SECTION, SEMICOLON, SPACE, or TAB.
textQualifier
String
Symbol used to indicate where a text begins and ends. Value must be DOUBLE_QUOTE, SINGLE_QUOTE, or NO_QUOTE.
codepage
String
Code page used for the export file. Value must be UTF8.
dateFormat
String
Format used for dates. Use one of the following formats:
  • - DE. For dd.mm.yyyy format.
  • - ISO. For yyyy-mm-dd format.
  • - US. For mm/dd/yyyy format.
containerType
String
Type of asset that contains value mappings. Value must be crosswalk.
containerId
String
The ID of the crosswalk to which you want to import value mappings.
Note: You can find the ID of assets in Reference 360 or use REST APIs to retrieve the IDs. For more information, see Asset IDs.
startingRow
String
Line number from which to start importing data. By default, all rows are imported.

POST response

The response contains the details of the import job.
The following table describes the attributes in the response:
Field
Type
Description
jobId
String
ID of the job.
state
String
Status of the job. Values are CREATED, INPROGRESS, COMPLETED, SUSPENDED, FAILED, STOPPED, QUEUED or WARNING.
startTime
Number
Time, in milliseconds, when the job started.
numOfRecordsProcessed
Number
Number of records processed.
numOfRecordsFailed
Number
Number of records that failed to be imported.
numOfRecordsSucceeded
Number
Number of records successfully imported.

POST example

To import value mappings into a crosswalk, you might use the following request:
POST https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=import-value-mappings.csv

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=importSettings
Content-Type: application/json;charset=UTF-8

{
"delimiter":"COMMA",
"textQualifier":"DOUBLE_QUOTE",
"codepage":"UTF8",
"dateFormat":"ISO",
"containerType":"CROSSWALK",
"containerId":"9ab3201990a54dcdc86f53AB",
"startingRow":null
}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
The CSV file might contain the following header rows and data rows:
sourcePKey,_from.id.sourcePKey,_to.id.sourcePKey
sourcePKey,_from.id.sourcePKey,_to.id.sourcePKey
AF_AFG,AF,AFG
AL_ALA,AL,ALA
ALB_ALB,ALB,ALB
DZ_DZA,DZ,DZA
AS_ASM,AS,ASM
The following sample response shows the status of the import job:
{
"jobId": "dd1b2018cb47cef99f8d0f43",
"state": "INPROGRESS",
"startTime": 1561367377428,
"numOfRecordsProcessed": 100,
"numOfRecordsFailed": 25,
"numOfRecordsSucceeded": 75
}

Import hierarchy relationships

Imports hierarchy relationships for code values and top-level code values into a hierarchy.

POST request

To import hierarchy relationships, submit a POST request with the following URI:
/rdm-service/external/v1/import/hierarchy
The request contains form-data with two parameters:
file
Specify a CSV file that contains the hierarchy relationships. The CSV file contains one header row with two columns: Code and ParentCode. You can list the related code values below the header.
For example, you might have the following relationships in the CSV file:
Code,ParentCode
C1,P1
C2,P2
C1,P3
If you import top-level code values, only use the Code column in the header row.
For example, you might have the following top-level code values:
Code
P1
P2
P3
importSettings
Specify the file specific configuration and container details.
The importSettings includes the following attributes:
Field
Type
Description
delimiter
String
Delimiter used to separate values. Value must be ASTERISK, CIRCUMFLEX, COLON, COMMA, PIPE, SECTION, SEMICOLON, SPACE, or TAB.
textQualifier
String
Symbol used to indicate where a text begins and ends. Value must be DOUBLE_QUOTE, SINGLE_QUOTE, or NO_QUOTE.
codepage
String
Code page used for the export file. Value must be UTF8.
hierarchyId
String
ID of the hierarchy to which you want to import relationships.
Note: You can find the ID of assets in Reference 360 or use REST APIs to retrieve the IDs. For more information, see Asset IDs.
parentCodeListId
String
ID of the parent code list.
Note: If you import top-level code values, you do not need to provide this attribute.
childCodeListId
String
ID of the child code list.
startingRow
String
Line number from which to start importing data. By default, all rows are imported.

POST response

The response contains details of the import job.
The following table describes the attributes in the response:
Field
Type
Description
jobId
String
ID of the job.
state
String
Status of the job. Values are CREATED, INPROGRESS, COMPLETED, SUSPENDED, FAILED, STOPPED, QUEUED or WARNING.
startTime
Number
Time, in milliseconds, when the job started.
numOfRecordsProcessed
Number
Number of records processed.
numOfRecordsFailed
Number
Number of records that failed to be imported.
numOfRecordsSucceeded
Number
Number of records successfully imported.

POST example

To import hierarchy relationships into a hierarchy, you might use the following request:
POST https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import/hierarchy HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=import.csv
Content-Type: text/plain

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=importSettings
Content-Type: application/json;charset=UTF-8

{
"delimiter":"COMMA",
"textQualifier":"DOUBLE_QUOTE",
"startingRow":0,
"codepage":"UTF8",
"hierarchyId":"c79ab91c19b13b11d8d43770",
"childCodeListId":"96f06071e4aaea81ff203abe",
"parentCodeListId":"9b300f793470882ca23e6091"
}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
The CSV file might contain the following header row and data rows:
Code,ParentCode
C1,P1
C2,P2
C3,P3
To import top-level code values into a hierarchy, you might use the following request:
POST https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import/hierarchy HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=file; filename=import.csv
Content-Type: text/plain

--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
Content-Disposition: form-data; name=importSettings
Content-Type: application/json;charset=UTF-8

{
"delimiter":"COMMA",
"textQualifier":"DOUBLE_QUOTE",
"startingRow":0,
"codepage":"UTF8",
"hierarchyId":"c79ab91c19b13b11d8d43770",
"childCodeListId":"96f06071e4aaea81ff203abe"
}
--6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm--
The CSV file might contain the following header row and data rows:
Code
P1
P2
P3
The following sample response shows that status of the import job:
{
"jobId":"73580d323feb170be5ec0fd5",
"state":"INPROGRESS",
"startTime":1603092643055,
"numOfRecordsProcessed":100,
"numOfRecordsFailed":25,
"numOfRecordsSucceeded":75
}

Get import job status

Retrieves the status of an import job.

GET request

To get the status of an import job, submit a GET request with the following URI:
/rdm-service/external/v1/import/job/<job ID>

GET response

The response contains the details of the import job, such as the status of the import job, start time, and number of records processed for import.
The following table describes the attributes in the response:
Field
Type
Description
jobId
String
ID of the job.
state
String
Status of the job. Values are CREATED, INPROGRESS, COMPLETED, SUSPENDED, FAILED, STOPPED, QUEUED or WARNING.
startTime
Number
Time, in milliseconds, when the job started.
numOfRecordsProcessed
Number
Number of records processed.
numOfRecordsFailed
Number
Number of records that failed to be imported.
numOfRecordsSucceeded
Number
Number of records successfully imported.

GET example

To get the status of an import job, you might use the following request:
GET https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import/job/dd1b2018cb47cef99f8d0f42 HTTP/1.1
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX
The following sample response shows the status of an import job:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 193

{
"jobId":"dd1b2018cb47cef99f8d0f42",
"state":"INPROGRESS",
"startTime":1561367376330,
"numOfRecordsProcessed":100,
"numOfRecordsFailed":25,
"numOfRecordsSucceeded":75
}

Get failed import job report

Retrieves an error report for a failed import job.
By default, the error report shows the first 100,000 records. To retrieve more records or to view the next page of records in the error report, use the query parameters.

GET request

To retrieve an error report for a failed import job, submit a GET request with the following URI:
/rdm-service/external/v1/import/job/<job Id>/errorDetails
To retrieve the paginated error report, submit a GET request with the following query parameters appended to the URI:
/rdm-service/external/v1/import/job/<job Id>/errorDetails?pageNum=<page number>&recordsPerPage=<records per page>

GET request query parameters

You can append the query parameters to the URI to retrieve paginated errors.
The following table lists the query parameters:
Parameter
Description
pageNum
Optional. Page number to display. Default value is 0.
recordsPerPage
Optional. Number of records to display per page. Default value is 100000.

GET response

The response contains the error details, such as the line where the error occurred and the reason.
The following table describes the attributes in the response:
Field
Type
Description
jobId
String
ID of the job.
entityType
String
Type of entity imported. Value is BusinessEntity or Relationship.
fileName
String
Name of the file. Value must end with the .csv file extension.
entityName
String
Name of the entity.
errorDetails
-
Includes the error details.
lineNumber
Number
Line number where the error occurred.
entitySourcePkey
String
Column identifier.
reasons
Array
Explanation of failure.

GET example

To retrieve an error report for a failed import job, you might use the following request:
GET https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import/job/dae4301e9369c16c08bf0881/errorDetails HTTP/1.1
To retrieve the second page of records in a paginated error report with 100 records per page, you might use the following request:
GET https://use4-mdm.dm-us.informaticacloud.com/rdm-service/external/v1/import/job/dae4301e9369c16c08bf0881/errorDetails?pageNum=2&recordsPerPage=100 HTTP/1.1
The following sample response shows the error report for a failed code values import job:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 395
IDS-SESSION-ID: XXXXXXXXXXXXXXXXXXXXXX

{
"jobId":"5984980d317a4b00cfe18880",
"entityType":"BusinessEntity",
"fileName":"import.csv",
"entityName":"rdm.value.be.442ac56e11d5fc9bb11f6a3f",
"errorDetails":[
{
"lineNumber":1,
"entitySourcePkey":"Code-1101",
"reasons":[
"The code value INX does not exist in the picklist that is in the path Country. Specify a code value from the picklist."
]
}
]
}
The following sample response shows the error report for a failed value mappings import job:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 354

{
"jobId":"dae4301e9369c16c08bf0881",
"entityType":"Relationship",
"fileName":"import.csv",
"entityName":"rdm.crosswalk.rel.21ffd6b5f92d10c744acc27c.fc66c441288cf898c6fe5023",
"errorDetails":[
{
"lineNumber":1,
"entitySourcePkey":"AF_AFG",
"reasons":[
"The requested resource with ID 'AFG' does not exist."
]
}
]
}