APIs
Storage API
4 min
csv import/export api { "tab" "examples", "url" "/storage/file/import/s", "name" "import data file", "method" "put", "request" { "pathparameters" \[], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "kind" "required", "name" "file", "type" "object", "children" \[], "description" "submitted file object" }, { "kind" "required", "name" "request", "type" "object", "children" \[ { "kind" "required", "name" "storagetype", "type" "integer", "description" "specifies the import file storage type for import/export, the only valid type should be storagetype businessdocumentimports and sotragetype busienssdocumentexports" }, { "kind" "required", "name" "owneraccountid", "type" "number", "description" "api server will always overwrite it with accountid obtained from authorized token" }, { "kind" "required", "name" "importexportconfig", "type" "object", "children" \[ { "kind" "required", "name" "systemdefinedfullclassname", "type" "string", "description" "a c# system full class name is required when requesting a file import/export for a specific system entity (e g specify \\"oelite common marketing target\\" is required for target csv import)" }, { "kind" "optional", "name" "snapshotrecordcount", "type" "number", "description" "specify whether to return a number of rows of uploaded file if it is a csv file for import mapping" } ], "description" "" } ], "description" "file item data association data" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "naxkcyjvbebxsndrcryhp", "code" "{\n \\"data\\" {\n \\"fileitemid\\" 987,\n \\"filesnapshot\\" {\n \\"headers\\" \[\n \\"id\\",\n \\"first name\\",\n \\"last name\\",\n \\"business name\\",\n \\"is hot lead\\",\n \\"email\\"\n ],\n \\"records\\" \[\n \[\n \\"123\\",\n \\"susan1\\",\n \\"johns\\",\n \\"johns pizza\\",\n \\"true\\",\n \\"susan1 johns\@example com\\"\n ],\n \[\n \\"124\\",\n \\"susan2\\",\n \\"johns\\",\n \\"johns pizza\\",\n \\"true\\",\n \\"susan2 johns\@example com\\"\n ],\n \[\n \\"125\\",\n \\"susan3\\",\n \\"johns\\",\n \\"johns pizza\\",\n \\"true\\",\n \\"susan3 johns\@example com\\"\n ],\n \[\n \\"126\\",\n \\"susan4\\",\n \\"johns\\",\n \\"johns pizza\\",\n \\"true\\",\n \\"susan4 johns\@example com\\"\n ],\n \[\n \\"127\\",\n \\"susan5\\",\n \\"johns\\",\n \\"johns pizza\\",\n \\"true\\",\n \\"susan5 johns\@example com\\"\n ]\n ]\n },\n \\"importentitydatafields\\" \[\n {\n \\"name\\" \\"first name\\",\n \\"alias\\" \\"target firstname\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ true\n },\n {\n \\"name\\" \\"last name\\",\n \\"alias\\" \\"target lastname\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"middle name\\",\n \\"alias\\" \\"target middlename\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"date ofbirth\\",\n \\"alias\\" \\"target dob\\",\n \\"valuetype\\" 40,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"name\\",\n \\"alias\\" \\"target name\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"department\\",\n \\"alias\\" \\"target department\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not call\\",\n \\"alias\\" \\"target donotcall\\",\n \\"valuetype\\" 11,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not call requested by recipieent\\",\n \\"alias\\" \\"target donotcallrequestedbyrecipient\\",\n \\"valuetype\\" 11,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not call requested by recipient on date\\",\n \\"alias\\" \\"target donotcallrequestedbyrecipientonutc\\",\n \\"valuetype\\" 41,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not email\\",\n \\"alias\\" \\"target donotemail\\",\n \\"valuetype\\" 11,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not email requested by recipient\\",\n \\"alias\\" \\"target donotemailrequestedbyrecipient\\",\n \\"valuetype\\" 11,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"do not email requeested by recipient on date\\",\n \\"alias\\" \\"target donotemailrequestedbyrecipientonutc\\",\n \\"valuetype\\" 41,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"home phone number\\",\n \\"alias\\" \\"target homephonenumber\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"work phone number\\",\n \\"alias\\" \\"target workphonenumber\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"mobile phone number\\",\n \\"alias\\" \\"target mobilephonenumber\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"fax number\\",\n \\"alias\\" \\"target faxnumber\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"email\\",\n \\"alias\\" \\"target email\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"campaignid\\",\n \\"alias\\" \\"associatedcampaignid\\",\n \\"valuetype\\" 10,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"assignedtouserid\\",\n \\"alias\\" \\"assignedtouserid\\",\n \\"valuetype\\" 10,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"status\\",\n \\"valuetype\\" 30,\n \\"ismandatory\\"\ false\n }\n ],\n \\"importassociationdatafields\\" \[\n {\n \\"name\\" \\"campaign id\\",\n \\"alias\\" \\"target associatedcampaignid\\",\n \\"valuetype\\" 10,\n \\"ismandatory\\"\ false\n },\n {\n \\"name\\" \\"assigned to user id\\",\n \\"alias\\" \\"target assignedtouserid\\",\n \\"valuetype\\" 10,\n \\"ismandatory\\"\ false\n }\n ]\n }\n \\"success\\"\ true\n}", "language" "200", "customlabel" "" }, { "id" "ps4smjaml9haegvhqpt2c", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }", "language" "404", "customlabel" "" } ], "selectedlanguageid" "naxkcyjvbebxsndrcryhp" }, "examples" { "languages" \[ { "id" "6tbpcunf55ditttap3cwc", "code" "// note code represent fileitemassociationdata request json data only\n{\n\n \\"storagetype\\" 21,\n \\"importexportconfig\\" {\n \\"systemdefinedfullclass\\" \\"oelite common marketing target\\",\n \\"snapshotrecordcount\\" 5\n }\n \n}", "language" "json", "customlabel" "" } ], "selectedlanguageid" "6tbpcunf55ditttap3cwc" }, "description" "single file import endpoint ", "currentnewparameter" { "label" "body parameter", "value" "bodydataparameters" } } response a responsemessage wrapped with fileitemimportresponse data object should be expected { "tab" "examples", "url" "/storage/file/import/s/confirm/{fileitemid}", "name" "confirm import/export job", "method" "post", "request" { "pathparameters" \[ { "kind" "required", "name" "fileitemid", "type" "number", "children" \[], "description" "the file item id of the newly uploaded import file (which is obtained from /storage/file/import/s upload endpoint)" } ], "queryparameters" \[], "headerparameters" \[], "bodydataparameters" \[ { "kind" "required", "name" "request", "type" "object", "children" \[ { "kind" "required", "name" "storagetype", "type" "string", "description" "specifies the import file storage type for import/export, the only valid type should be storagetype businessdocumentimports and sotragetype busienssdocumentexports" }, { "kind" "required", "name" "owneraccountid", "type" "integer", "description" "provide if to associ" }, { "kind" "required", "name" "importexportconfig", "type" "object", "children" \[ { "kind" "required", "name" "systemdefinedfullclass", "type" "string", "description" "a c# system full class name is required when requesting a file import/export for a specific system entity (e g specify \\"oelite common marketing target\\" is required for target csv import)" }, { "kind" "required", "name" "csvheadermappers", "type" "array", "description" "an array of simplenamevaluepair (angular) for mapping import/export csv headers with system designed object entity fields\n\nnote the key should be the entifyfieldalias obtained from the import upload endpoint" }, { "kind" "optional", "name" "entityassociations", "type" "array", "description" "an array of simplenamevaluepair (angular) for mapping any relationships of the imported records with other entities in the platform\n\nnote the key should be the entifyfieldalias obtained from the import upload endpoint" } ], "description" "" } ], "description" "file item data association data" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "tric9ku3xmsn3fdj4uob8", "code" "{\n data \[],\n totalrecordscount 0 \n}", "language" "200", "customlabel" "" }, { "id" "xopkdlemrsnjvwiijvwsq", "code" "{\n \\"message\\" \\"ain't no cake like that \\"\n }", "language" "404", "customlabel" "" } ], "selectedlanguageid" "tric9ku3xmsn3fdj4uob8" }, "examples" { "languages" \[ { "id" "ka8dtvjvqppit1mbqk0tq", "code" "// note code represent fileitemassociationdata request json data only\n{\n\n \\"storagetype\\" 21,\n \\"importexportconfig\\" {\n \\"systemdefinedfullclass\\" \\"oelite common marketing target\\",\n \\"csvheadermappers\\" {\n \\"target firstname\\" \\"first name\\",\n \\"target lastname\\" \\"last name\\",\n \\"target name\\" \\"business name\\",\n \\"target email\\" \\"email\\"\n },\n \\"entityassociations\\" {\n \\"associatedcampaignid\\" 234,\n \\"assignedtouserid \\" 8887\n }\n }\n}", "language" "json", "customlabel" "" } ], "selectedlanguageid" "ka8dtvjvqppit1mbqk0tq" }, "description" "to confirm/update and trigger a file import/export job", "currentnewparameter" { "label" "path parameter", "value" "pathparameters" } } 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