How to integrate with File Import APIs
Initiating a file import
To import a file into the FDP, you must first initiate the process using the import file
API referenced in the API documentation.
This API accepts file metadata and field mappings, then generates a pre-signed secure URL for direct uploads to our cloud storage system. The URL is protected by a short-lived access token, valid for up to 5 minutes, and supports file uploads up to 1000 MB.
For example, suppose you have a CSV file containing customer data that you want to upload to the FDP but only wish to include specific fields such as first name, last name, and email. Using the sample file below, you would submit an import file request with three field mappings, linking the relevant CSV indexes to the scv user
module.
Example CSV File
id | first_name | last_name | gender | age | |
---|---|---|---|---|---|
1 | Jane | Doe | [email protected] | Female | 55 |
Example import file API Request
{
"name": "Integrator file import test",
"service": "SCV", // indicates FDP is the destination service
"mapping": { // CSV to target entity field mappings
"fields": [
{
"index": 1,
"targetFieldName": "firstName",
"targetEntity": "scv_user"
},
{
"index": 2,
"targetFieldName": "lastName",
"targetEntity": "scv_user"
},
{
"index": 3,
"targetFieldName": "emailAddress",
"targetEntity": "scv_user"
}
]
}
}
{
"fileImport": {
"id": "6732115e04a38be4f744fa21",
"clientId": "CORTEX",
"name": "Fan data updates 2024",
"filename": "fan_data.csv",
"importKey": "imports/SCV/CORTEX/c243a922-282c-4e0d-8a8e-bb222ab28092",
"service": "SCV",
"status": "ReadyToImport",
"importType": "API_KEY",
"mapping": {
"fields": [
{
"index": 1,
"targetFieldName": "firstName",
"mapped": true
},
{
"index": 2,
"targetFieldName": "lastName",
"mapped": true
},
{
"index": 3,
"targetFieldName": "email",
"mapped": true
}
]
}
},
"url": "https://file-management-system-stage.s3.eu-west-1.amazonaws.com/imports/SCV/CORTEX/c243a922-282c-4e0d-8a8e-bb222ab28092?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA52IDDUHLUCKVUUFG/20241111/eu-west-1/s3/aws4_request&X-Amz-Date=20241111T141454Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&x-id=PutObject&X-Amz-Signature=9b9f6415378025bd4a7d4432ac0608cebc604bba528ff781ecd27329b3e99d87"
}
Authentication
All APIs detailed in this guide require authentication using an API key, which will be provided by the Cortex support team.
Header | What’s it for | Example Value |
---|---|---|
X-API-KEY | Defines the key or password the caller is authenticating with. | super-secure-key-123 |
Updated 19 days ago