Import API
6 minute read
You can use the sample mutations in this topic as a starting point to create mutations for common document import tasks and case updates.
The Connect API Explorer includes three mutations that you can use to import documents into a case: importJobCreate
, importJobAddDocuments
, and importJobSubmit
.
Note
If the import job setting is to copy files from S3, once the files are copied, the application deletes the files from the S3 bucket. The application deletes the files for only those import jobs that completed successfully. The application does not delete files in failed import jobs.Create an import job
You can create an import job in a case using the importJobCreate
mutation. This mutation returns the rdxJobID
, which is used in the next mutation to add documents to the import job. This mutation also allows you to configure some job-level settings.
Sample mutation:
mutation MySampleMutation {
importJobCreate
(
caseId: 5,
input:
{
description: "test",
name: "Clean Enron",
documentIdType: Existing
}
)
{
rdxJobId
}
}
Sample response:
{
"data": {
"importJobCreate": {
"rdxJobId": 319
}
}
}
Configurable options:
name
: String is the name of the import job. If you do not provide a value for this option, the job name is “Import from API.”description
: String is the description of the import job. If you do not provide a value for this option, the job description is “Import from API.”level
: String determines the root level to put documents in. If you do not provide a value for this option, the level is “API/{ImportID}/0001.” Level values assigned to documents in the importJobAddDocuments mutation override this setting.docsPerLevel
: Integer determines the maximum number of documents per level. If you do not provide a value for this option, the value is 1000.updateGroupCoding
: Boolean updates the group coding fields (All Custodians, for example) for new documents in this import and any existing or future family duplicate documents. If you do not provide a value for this option, the value is “false.”
Add documents to an import job
You can use the importJobAddDocuments
mutation to add documents to an import job that was created using the importJobCreate
mutation. Each importJobAddDocuments
mutation allows you to add up to 5000 documents. To add additional documents to the job, run multiple mutations with different documents.
Note
When defining the path value for pages and content files, the path is relative to the “import” folder in the Image file repository defined for the case.For example, if the path is defined as follows:
path:“Imports\Media0001\Images\0001\DOC-00000001.tif”
then the file should be located at:
{Image file repository}\import{case name}\Imports\Media0001\Images\0001\DOC-00000001.tif.
Sample mutation:
mutation {
importJobaddDocuments (
caseId:26,
rdxJobId:319,
documents:[
{
documentId:"DOC-00000001",
hash:"qwer1234asdf5678zxcv1234qwer5678",
familyhash:"poui1234asdf5678zxcv1234qwer5678",
level:"Imports/Custom/0001",
parentId:"",
sourceattachmentaction:Delete,
pageaction:InsertUpdate
mainfields:[
{
name:DocumentDate,value:"2019-01-03",action:Update
},
{
name:DocumentType,value:"Microsoft Outlook Message",action:Update
},
{
name:DocumentTitle,value:"Re: Your message",action:Update
},
{
name:DocumentDescription,value:"",action:Delete
},
{
name:EstimatedDate,value:"False",action:Update
}
],
fields:[
{
name:"Custodian",onetomany:false,type:PickList,action:InsertUpdate,values:"Custodian A"
},
{
name:"[Meta] Processing Exceptions",type:PickList,action:InsertUpdate,values:["Corrupted","Empty File"]
},
{
name:"[Meta] File Name",onetomany:false,type:Text,action:InsertUpdate,values:"Re: Your message.msg"
},
{
name:"[Meta] File Path",onetomany:false,type:Memo,action:InsertUpdate,values:"C:\\Downloads\\Email"
},
{
name:"[Meta] File Size",onetomany:false,type:Number,action:Delete,values:"1592"
},
{
name:"[Meta] Date Sent",onetomany:false,type:DateTime,action:InsertUpdate,values:"2019-01-03"
},
],
correspondence:[
{
type:"From",people:"acustodian@example.com",orgs:"example.com",action:InsertUpdate
},
{
type:"To",people:"bsmith@example.com",action:Append
},
{
type:"CC",people:["kjohnson@example.com","ewilliams@example.com"],action:InsertUpdate
}
],
pages:[
{
pagenumber:1,pagelabel:"DOC-00000001",path:"Imports\\Media0001\\Images\\0001\\DOC-00000001.tif"
},
{
pagenumber:2,pagelabel:"DOC-00000002",path:"Imports\\Media0001\\Images\\0001\\DOC-00000002.tif"
}
]
,
contentfiles:[
{
path:"Imports\\Media0001\\Natives\\0001\\DOC-00000001.mht"
}
]
},
{
documentId:"DOC-00000003",
hash:"6425hyjkasdf5678zxcv1234qwer5678",
familyhash:"poui1234asdf5678zxcv1234qwer5678",
level:"Imports/Custom/0001",
parentId:"DOC-00000001",
sourceattachmentaction:InsertUpdate,
pageaction:InsertUpdate
mainfields:[
{
name:DocumentDate,value:"2019-01-02",action:Update
},
{
name:DocumentType,value:"Microsoft Word",action:Update
},
{
name:DocumentTitle,value:"WordDoc.docx",action:Update
},
{
name:DocumentDescription,value:"Sample description",action:Update
},
{
name:EstimatedDate,value:"False",action:Update
}
],
fields:[
{
name:"Custodian",onetomany:false,type:PickList,action:InsertUpdate,values:"Custodian A"
},
{
name:"[Meta] File Name",onetomany:false,type:Text,action:InsertUpdate,values:"WordDoc.docx"
},
{
name:"[Meta] File Path",onetomany:false,type:Memo,action:InsertUpdate,values:"C:\\Downloads\\Email\\Re: Your message.msg"
},
{
name:"[Meta] File Size",onetomany:false,type:Number,action:InsertUpdate,values:"74326"
},
{
name:"[Meta] Date Modified",onetomany:false,type:DateTime,action:InsertUpdate,values:"2019-01-02"
},
],
pages:[
{
pagenumber:1,pagelabel:"DOC-00000003",path:"Imports\\Media0001\\Natives\\0001\\DOC-00000003.docx"
}
]
}
]
)
{
documentCount
}
}
Sample response:
{
"data": {
"importJobAddDocuments": {
"documentCount": 2
}
}
}
Configurable options:
documentId
: String imports the Document ID of the document.hash
: String imports the individual MD5 hash value of the document. This value is added to the[RT] MD5 Hash
field in the case.familyhash
: String imports the family MD5 hash value of the document. This value is added to the[RT] Family MD5 Hash
field in the case.level
:String
, when set, overrides any level data set in the job options. Levels are not updated for existing documents.parentId
: String is the parent document ID for the document that establishes a source/attachment relationship. The source/attachment relationship is either updated or deleted depending on the value set for sourceattachmentaction.sourceattachmentaction
: SAAction determines which of the following actions to take for the parentId field:Delete
removes coding from the document for the field.InsertUpdate
inserts or updates the value(s) of the field.
pageaction
:Action
determines which of the following actions to take on the pages:Append
appends the value(s) to the field. This applies only to one-to-many fields.Delete
removes coding from the document for the field.InsertUpdate
inserts or updates the value(s) of the field.
mainfields
:[DocumentFieldParams]
imports the following data into core document fields in the case.name
:DocumentField!
is the name of the document field. The names correspond to the core document fields in the case:DocumentDate
,DocumentDescription
,DocumentTitle
,DocumentType
,EstimatedDate
.value
:String
determines which of the following values is populated in the document field.DocumentDate
is the Document Date of the document. Format is YYYY-MM-DD.DocumentDescription
is the Document Description of the document.DocumentTitle
is the Document Title of the document.DocumentType
is the Document Type of the document.EstimatedDate
is the Estimated Date of the document. A Boolean value.
action
:CoreAction!
determines which of the following actions to take on the incoming field data:Update
inserts or updates the value(s) of the field.Delete
removes coding from the document for the field.Ignore
ignores the value.
fields
:[FieldParams]
imports the following data into fields in the case:name
:String!
Is the name of the field. If the field exists, the existing field will be used. If not, the name is created with the field type indicated.onetomany
:Boolean
defines whether the field is one to many.type
:FieldType!
is the field type. The possible values are as follows:Boolean
allows you to set the value as Yes or No.DateTime
allows you to set the value in YYYY-MM-DD format.Memo
Number
PickList
Text
action
:Action!
determines which of the following actions to take on the incoming data:Append
appends the value(s) to the field (only for one-to-many field types).Delete
removes coding from the document for the field.InsertUpdate
inserts or updates the value(s) of the field.
values
:[String]!
imports the value(s) for the field.
correspondence
:[CorrespondenceType]
imports the following people and organization values for the document:type
:String!
determines the correspondence type. Possible values are To, From, CC, or BCC.people
:[String]
contains a list of people values.orgs
:[String]
contains a list of organization values.action
:Action!
determines which of the following actions to take on the incoming field data:Append
appends the value(s) to the field (only for one to many field types).Delete
removes coding from the document for the field.InsertUpdate
inserts or updates the value(s) of the field.
pages
:[PagesParams]
imports the following values for the pages associated with the document:pagenumber
:Int!
is the page number.pagelabel
:String
is the page label of the page.path
:String!
is the location of the physical file to upload.
contentfiles
:[ContentFileParams]
imports the list of content files for the document.path
:String!
imports the location of the physical file to upload.
Submit an import job
After adding documents to a job using the importJobAddDocuments
mutation, you can run the import job using the importJobSubmit
mutation.
Sample mutation:
mutation MySampleMutation {
importJobSubmit (
caseId: 5,
input: {
rdxJobId: 10
}
)
{
rpfJobId
}
}
Feedback
Was this page helpful?
Thank you for your feedback.
Thank you for your feedback.