Storage API
4 min
CSV Import/Export API
Import data file
single file import endpoint.
PUT
/storage/file/import/s
Body Parameters
- fileObjectrequiredDescription
- requestObjectrequiredDescription
- storageTypeIntegerrequiredDescription
- ownerAccountIdNumberrequiredDescription
- importExportConfigObjectrequired
- systemDefinedFullClassNamestringrequiredDescription
- snapshotRecordCountNumberDescription
json
// Note: code represent FileItemAssociationData request json data only
{
"storageType": 21,
"importExportConfig": {
"systemDefinedFullClass": "OElite.Common.Marketing.Target",
"snapshotRecordCount": 5
}
}200
{
"data":{
"fileItemId":987,
"fileSnapshot":{
"headers":[
"Id",
"First Name",
"Last Name",
"Business Name",
"Is Hot Lead",
"Email"
],
"records":[
[
"123",
"Susan1",
"Johns",
"Johns Pizza",
"true",
"[email protected]"
],
[
"124",
"Susan2",
"Johns",
"Johns Pizza",
"true",
"[email protected]"
],
[
"125",
"Susan3",
"Johns",
"Johns Pizza",
"true",
"[email protected]"
],
[
"126",
"Susan4",
"Johns",
"Johns Pizza",
"true",
"[email protected]"
],
[
"127",
"Susan5",
"Johns",
"Johns Pizza",
"true",
"[email protected]"
]
]
},
"importEntityDataFields":[
{
"name":"First Name",
"alias":"target.firstName",
"valueType":30,
"isMandatory":true
},
{
"name":"Last Name",
"alias":"target.lastName",
"valueType":30,
"isMandatory":false
},
{
"name":"Middle Name",
"alias":"target.middleName",
"valueType":30,
"isMandatory":false
},
{
"name":"Date OfBirth",
"alias":"target.dob",
"valueType":40,
"isMandatory":false
},
{
"name":"Name",
"alias":"target.name",
"valueType":30,
"isMandatory":false
},
{
"name":"Department",
"alias":"target.department",
"valueType":30,
"isMandatory":false
},
{
"name":"Do Not Call",
"alias":"target.doNotCall",
"valueType":11,
"isMandatory":false
},
{
"name":"Do Not Call Requested By Recipieent",
"alias":"target.doNotCallRequestedByRecipient",
"valueType":11,
"isMandatory":false
},
{
"name":"Do Not Call Requested By Recipient On Date",
"alias":"target.doNotCallRequestedByRecipientOnUtc",
"valueType":41,
"isMandatory":false
},
{
"name":"Do Not Email",
"alias":"target.doNotEmail",
"valueType":11,
"isMandatory":false
},
{
"name":"Do Not Email Requested By Recipient",
"alias":"target.doNotEmailRequestedByRecipient",
"valueType":11,
"isMandatory":false
},
{
"name":"Do Not Email Requeested By Recipient On Date",
"alias":"target.doNotEmailRequestedByRecipientOnUtc",
"valueType":41,
"isMandatory":false
},
{
"name":"Home Phone Number",
"alias":"target.homePhoneNumber",
"valueType":30,
"isMandatory":false
},
{
"name":"Work Phone Number",
"alias":"target.workPhoneNumber",
"valueType":30,
"isMandatory":false
},
{
"name":"Mobile Phone Number",
"alias":"target.mobilePhoneNumber",
"valueType":30,
"isMandatory":false
},
{
"name":"Fax Number",
"alias":"target.faxNumber",
"valueType":30,
"isMandatory":false
},
{
"name":"Email",
"alias":"target.email",
"valueType":30,
"isMandatory":false
},
{
"name":"CampaignId",
"alias":"associatedCampaignId",
"valueType":10,
"isMandatory":false
},
{
"name":"AssignedToUserId",
"alias":"assignedToUserId",
"valueType":10,
"isMandatory":false
},
{
"name":"Status",
"valueType":30,
"isMandatory":false
}
],
"importAssociationDataFields":[
{
"name":"Campaign Id",
"alias":"target.associatedCampaignId",
"valueType":10,
"isMandatory":false
},
{
"name":"Assigned To User Id",
"alias":"target.assignedToUserId",
"valueType":10,
"isMandatory":false
}
]
}
"success":true
}404
{
"message": "Ain't no cake like that."
}Response
A ResponseMessage wrapped with FileItemImportResponse data object should be expected
Confirm Import/Export Job
To confirm/update and trigger a file import/export job
POST
/storage/file/import/s/confirm/{fileItemId}
Path Parameters
- fileItemIdNumberrequiredDescription
Body Parameters
- requestObjectrequiredDescription
- storageTypestringrequiredDescription
- ownerAccountIdIntegerrequiredDescription
- importExportConfigObjectrequired
- systemDefinedFullClassstringrequiredDescription
- csvHeaderMappersArrayrequiredDescription
- entityAssociationsArrayDescription
json
// Note: code represent FileItemAssociationData request json data only
{
"storageType": 21,
"importExportConfig": {
"systemDefinedFullClass": "OElite.Common.Marketing.Target",
"csvHeaderMappers": {
"target.firstName": "First Name",
"target.lastName": "Last Name",
"target.name": "Business Name",
"target.email": "Email"
},
"entityAssociations": {
"associatedCampaignId": 234,
"assignedToUserId:" 8887
}
}
}200
{
data: [],
totalRecordsCount: 0
}404
{
"message": "Ain't no cake like that."
}Response
A FileItemCollection response should be expected. Which includes the confirmed import/export file(s) details
ImportExportConfig:
During import:
- CsvHeaderMappers property contains the mapping of the uploaded custom csv headers against related system defined entities (such as Users, Targets, Leads, etc. )
- EntityAssociations property containers the mapping of the bespoke relationship the imported records with the defined field. The system currently has the following defined fields:
entityAssociations field | value type | description |
|---|---|---|
associatedCampaignId | long | if applicable, associate the imported records with a specified campaign. Possible Record Types: Leads, Targets |
assignedToUserId | long | if applicable, assign the imported records to a specified user Possible Record Types: Campaigns, Leads, Targets, Opportunities, Customers |
associatedProductCategoryId | long | if applicable, associate the imported records with a specified product category Possible Record Types: Products |