{"id":37483061,"url":"https://github.com/relativitydev/relativity-export-samples","last_synced_at":"2026-01-16T07:28:58.529Z","repository":{"id":208221195,"uuid":"715443166","full_name":"relativitydev/relativity-export-samples","owner":"relativitydev","description":"Repository provides useful samples how Relativity Export API can be utilized.","archived":false,"fork":false,"pushed_at":"2025-02-18T13:51:10.000Z","size":157,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-18T14:44:03.778Z","etag":null,"topics":["csharp","dotnet","export","powershell","relativity","samples"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Relativity.Export.SDK","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/relativitydev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-07T06:38:42.000Z","updated_at":"2025-02-18T08:48:07.000Z","dependencies_parsed_at":"2023-11-20T12:30:18.156Z","dependency_job_id":"8df4e41c-166e-476e-8a62-ad150b6b74bf","html_url":"https://github.com/relativitydev/relativity-export-samples","commit_stats":null,"previous_names":["relativitydev/relativity-export-samples"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/relativitydev/relativity-export-samples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relativitydev%2Frelativity-export-samples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relativitydev%2Frelativity-export-samples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relativitydev%2Frelativity-export-samples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relativitydev%2Frelativity-export-samples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/relativitydev","download_url":"https://codeload.github.com/relativitydev/relativity-export-samples/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/relativitydev%2Frelativity-export-samples/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478047,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","export","powershell","relativity","samples"],"created_at":"2026-01-16T07:28:58.437Z","updated_at":"2026-01-16T07:28:58.514Z","avatar_url":"https://github.com/relativitydev.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Relativity Export SDK\n\n## Table of contents\n\n### [Introduction](#introduction)\n\n- [Prerequisites](#prerequisites)\n- [Gloassary](#glossary)\n\n### [Getting Started](#getting-started)\n\n- [Http Clients](#http-clients)\n- [Kepler .NET Client](#kepler-net-client)\n- [NuGet](#relativityexportsdk-nuget)\n- [Authorization](#authorization)\n- [Permissions](#permissions)\n- [Builders](#builders)\n- [General flow description](#general-flow-description)\n- [Example of simple export job flow](#example-of-simple-export-job-flow)\n- [Export Job States](#export-job-states)\n- [Error Codes](#error-codes)\n- [Export Job States](#export-job-states)\n\n### Code Samples\n\n- [List of samples](#list-of-samples)\n- [Kepler samples](#kepler-samples)\n- [Powershell samples](#powershell-samples)\n\n# Introduction\n\nThe _Relativity Export Service API_ is a service designed to facilitate the efficient export of documents, images, PDFs, native files, and Relativity Dynamic Objects (RDOs) from within Relativity workspaces.\n\nThis service leverages the RESTful API architecture to streamline the creation, configuration, and execution of export jobs, allowing for a seamless data transfer experience.\n\nWith its advanced job configuration options, the API offers a high degree of flexibility, enabling users to tailor the export process to specific requirements.\n\nMoreover, the service incorporates error handling mechanisms to swiftly pinpoint and address any issues that may arise during the export process, ensuring a smooth and reliable operation.\n\n## Prerequisites\n\n1. The following Relativity applications must be installed:\n   | Application | GUID | Location |\n   | --- | --- | --- |\n   | **Export** | 4abc11b0-b3c7-4508-87f8-308185423caf | workspace |\n   | **DataTransfer.Legacy** | 9f9d45ff-5dcd-462d-996d-b9033ea8cfce | instance |\n\n2. [Appropriate user permissions need to be set.](https://github.com/relativitydev/relativity-export-samples/tree/main#permissions)\n3. For .NET Kepler Client install these nugets:\n   - [Relativity.Export.SDK](https://www.nuget.org/packages/Relativity.Export.SDK)\n   - [Relativity.Kepler.Client.SDK](https://www.nuget.org/packages/Relativity.Kepler.Client.SDK/) - for .NET Kepler Client\n\n## Glossary\n\n**Data exporting** - Functionality that extracts data from selected workspace.\n\n**ExportJobSettings** - Configuration which decides about export behavior e.g. export source, items to export, structure of exported files, etc.\n\n**ExportJob** - Contains data about the job current state and progress. It is created during export job creation and is updated during export process.\n\n**Kepler service** - API service created but using the Relativity Kepler framework. This framework provides you with the ability to build custom REST Endpoints via a .NET interface. Additionally, the Kepler framework includes a client proxy that you can use when interacting with the services through .NET. \u003cbr\u003e\n[See more information](https://platform.relativity.com/RelativityOne/Content/Kepler_framework/Kepler_framework.htm#Client-s)\n\n**Item Error** - An error that may occur during the export process and concerns only one exported record from job.\n\n# Getting started\n\nExport Service is built as a standard Relativity Kepler Service. It provides sets of endpoints that must be called sequentially in order to execute export. The following sections outline how to make calls to export service.\n\n## HTTP Clients\n\nYou can make calls to a export service using any standard REST or HTTP client, because all APIs (Keplers APIs) are exposed over the HTTP protocol. You need to set the required X-CSRF-Header.\u003cbr\u003e\n[More details](https://platform.relativity.com/RelativityOne/Content/Kepler_framework/Kepler_framework.htm#Client-s)\n\n```cs\n    string usernamePassword = string.Format(\"{0}:{1}\", username, password);\n    string base64usernamePassword = Convert.ToBase64String(Encoding.ASCII.GetBytes(usernamePassword));\n\n    HttpClient client = new HttpClient();\n    client.DefaultRequestHeaders.Add(\"X-CSRF-Header\", \"-\");\n\n    // Basic authentication\n    client.DefaultRequestHeaders.Add(\"Authorization\", \"Basic \" + base64usernamePassword);\n\n    var createExportUri = $\"{relativityUrl}/export/v1/workspaces/{workspaceId}/jobs/{jobId}\";\n\n    var response = await httpClient.PostAsJsonAsync(createExportUri, payload);\n```\n\n## Kepler .NET Client\n\nYou can access Kepler service from any .NET language using the client library provided as part of the Kepler framework. It exposes a factory class that you can use to create the client proxy by passing URIs to export services and credentials. Then use .NET proxy to interact with a export service as a set of .NET objects. When you call a member method, the proxy makes a corresponding HTTP request to the respective service endpoint.\u003cbr\u003e\n[More details](https://platform.relativity.com/RelativityOne/Content/Kepler_framework/Kepler_framework.htm#Client-s)\n\n\u003e Example of factory creation:\u003cbr\u003e\n\u003e (Using `Relativity.Kepler.Client.SDK` package)\n\n```cs\npublic IServiceFactory GetServiceFactory()\n{\n    Uri relativityRestUri = new Uri($\"{this._host}relativity.rest/api\");\n    Credentials credentials = new UsernamePasswordCredentials(this._username, this._password);\n\n    ServiceFactorySettings settings = new ServiceFactorySettings(relativityRestUri, credentials);\n\n    // Create proxy factory.\n    return new ServiceFactory(settings);\n}\n```\n\n\u003e Example of proxy creation:\n\n```cs\n// Get the instance of the service factory.\nIServicefactory factory = GetServiceFactory();\n\n// Use the factory to create an instance of the proxy.\nusing Relativity.Export.V1.IExportJobManager jobManager = factory.CreateProxy\u003cRelativity.Export.V1.IExportJobManager\u003e();\n\n// Use the proxy to call the service.\nvar result = await jobManager.CreateAsync(\n    workspaceID,\n    jobID,\n    jobSettings,\n    applicationName,\n    correlationID);\n```\n\nKepler contracts for export service are exposed in `Relativity.Export.SDK` package.\n\nYou can also find factory implementations in the `Relativity.Kepler.Client.SDK` package\n\n## Relativity.Export.SDK NuGet\n\n`Relativity.Export.SDK` is a .NET library that contains kepler interfaces for export service. \u003cbr\u003e\nIt provides and simplifies executing export in client application. `Relativity.Export.SDK` targets `.NET Framework 4.6.2` and `.NET standard 2.0`.\n\n[![Version](https://img.shields.io/nuget/v/Relativity.Export.SDK?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FRelativity.Export.SDK)](https://www.nuget.org/packages/Relativity.Export.SDK)\n[![Nuget](https://img.shields.io/nuget/dt/Relativity.Export.SDK?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FRelativity.Export.SDK)](https://www.nuget.org/packages/Relativity.Export.SDK)\n\n### Installing via NuGet\n\n```\nInstall-Package Relativity.Export.SDK\n```\n\n### Installing via .NET CLI\n\n```\ndotnet add package Relativity.Export.SDK\n```\n\n## Relativity.Kepler.Client.SDK NuGet\n\nPublic Relativity Kepler Client SDK. \u003cbr\u003e\nContains implementation of factories for kepler services and proxies.\n\n[![Version](https://img.shields.io/nuget/v/Relativity.Kepler.Client.SDK?link=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FRelativity.Kepler.Client.SDK)](https://www.nuget.org/packages/Relativity.Kepler.Client.SDK/)\n[![Downloads](https://img.shields.io/nuget/dt/Relativity.Kepler.Client.SDK)](https://www.nuget.org/packages/Relativity.Kepler.Client.SDK/)\n\n### Installing via NuGet\n\n```\nInstall-Package Relativity.Kepler.Client.SDK\n```\n\n### Installing via .NET CLI\n\n```\ndotnet add package Relativity.Kepler.Client.SDK\n```\n\n## Authorization\n\n\u003e HTTP clients\n\nExport Service API conforms to the same authentication rules as other Relativity REST APIs.\u003cbr\u003e\nThe more details can be found under the following link: [REST API Authentication](https://platform.relativity.com/RelativityOne/Content/REST_API/REST_API_authentication.htm)\n\n\u003e Kepler .NET client\n\nThe Kepler framework uses a proxy to handle client requests. The more details can be found under the following link: [Proxies And Authentication](https://platform.relativity.com/RelativityOne/Content/Kepler_framework/Proxies_and_authentication.htm#Service)\n\n## Permissions\n\nThe following Relativity permissions are required to use export features provided in Export Service API.\n\n| Object Security Section       | Permissions         |\n| ----------------------------- | ------------------- |\n| Production                    | `View`              |\n| Relativity Export Service Job | `Add` `Edit` `View` |\n\n| Tab Visibility |\n| -------------- |\n| -              |\n\n| Admin Operation |\n| --------------- |\n| Allow Export    |\n\n## Builders\n\nBuilders provided in `Relativity.Export.SDK` package help to create settings for export job in correct and consistent way. It is highly recommended to prepare these objects in such a way in .NET application. They are implemented in fluent api pattern so it is very easy to use them. Moreover, using them in client application will avoid the risk of incorrect and inconsistent configuration which may lead to errors during export process.\n\nEach builder final step results in `IFinalStep\u003c\u003e` generic interface which is used to build final object via `Build()` method.\n\nMain components of export job settings are:\n\n- `ExportSourceSettings` - contains information about source of data to export\n- `ExportArtifactSettings` - contains information about artifacts to export\n- `ExportOutputSettings` - contains information about output format and structure of exported files\n\nwhich are all later combined into `ExportJobSettings`.\n\nThe following example shows how to create export job settings using builders that exports native, fulltext, images and PDF files from folder.\n\n### Example of ExportSourceSettings\n\n```cs\n// Export source settings\nvar sourceSettings = ExportSourceSettingsBuilder.Create()\n    .FromFolder(exportSourceArtifactID: folderID, viewID: viewID)\n    .WithSubfolders() // include subfolders\n    .WithCustomStartAtDocumentNumber(1)\n    .Build();\n```\n\n### Example of ExportArtifactSettings\n\n```cs\n// Artifact settings\nvar artifactSettings = ExportArtifactSettingsBuilder.Create()\n    .WithDefaultFileNamePattern()\n    .WithoutApplyingFileNamePatternToImages()\n    .ExportImages(settings =\u003e settings\n        .WithImagePrecedenceArtifactIDs(new List\u003cint\u003e { -1 }) // Exports images\n        .WithTypeOfImage(ImageType.Pdf))\n    .ExportFullText(settings =\u003e settings\n        .ExportFullTextAsFile()\n        .WithTextFileEncoding(\"UTF-8\")\n        .WithPrecedenceFieldsArtifactIDs(fulltextPrecedenceFieldsArtifactIds))\n    .ExportNative(settings =\u003e settings\n        .WithNativePrecedenceArtifactIDs(new List\u003cint\u003e { -1 })) // Exports native files\n    .ExportPdf() // Export PDF files\n    .WithFieldArtifactIDs(new List\u003cint\u003e { 1003676, 1003667 }) // Fields to export\n    .WithoutExportingMultiChoicesAsNested()\n    .Build();\n```\n\n### Example of ExportOutputSettings\n\n```cs\n// Subdirectory settings\nvar subdirectorySettings = SubdirectorySettingsBuilder.Create()\n    .WithSubdirectoryStartNumber(1)\n    .WithMaxNumberOfFilesInDirectory(100)\n    .WithDefaultPrefixes()\n    .OverridePrefixDefaults(prefixes =\u003e\n    {\n        // Optional overrides\n        prefixes.FullTextSubdirectoryPrefix = \"FULLTEXT_\";\n        prefixes.NativeSubdirectoryPrefix = \"NATIVE_\";\n        prefixes.ImageSubdirectoryPrefix = \"IMAGE_\";\n        prefixes.PdfSubdirectoryPrefix = \"PDF_\";\n    })\n    .WithSubdirectoryDigitPadding(5)\n    .Build();\n\n// Volume settings\nvar volumeSettings = VolumeSettingsBuilder.Create()\n    .WithVolumePrefix(\"VOL_FOLDER_\")\n    .WithVolumeStartNumber(1)\n    .WithVolumeMaxSizeInMegabytes(100)\n    .WithVolumeDigitPadding(5)\n    .Build();\n\n// Loadfile settings\nvar loadfileSettings = LoadFileSettingsBuilder.Create()\n    .WithoutExportingMsAccess()\n    .WithoutCustomCultureInfo()\n    .WithCustomDateFormat(\"O\")\n    .WithLoadFileFormat(LoadFileFormat.CSV)\n    .WithEncoding(\"UTF-8\")\n    .WithImageLoadFileFormat(ImageLoadFileFormat.IPRO)\n    .WithPdfFileFormat(PdfLoadFileFormat.IPRO_FullText)\n    .WithDelimiterSettings(delimiters =\u003e\n        delimiters.WithDefaultDelimiters())\n    .Build();\n\n// Output settings\nvar outputSettings = ExportOutputSettingsBuilder.Create()\n    .WithoutArchiveCreation()\n    .WithDefaultFolderStructure()\n\t.WithoutTransferJobID()\n    .WithDefaultDestinationPath()\n    .WithSubdirectorySettings(subdirectorySettings)\n    .WithVolumeSettings(volumeSettings)\n    .WithLoadFileSettings(loadfileSettings)\n    .Build();\n```\n\n### Combined settings\n\n```cs\n// Export job settings\nvar jobSettings = ExportJobSettingsBuilder.Create()\n    .WithExportSourceSettings(sourceSettings)\n    .WithExportArtifactSettings(artifactSettings)\n    .WithExportOutputSettings(outputSettings)\n    .Build();\n```\n\nIt's possible to use builders in a method chaining manner to create settings, but it's less readable and more error prone.\n\n\u003e Example\n\n```cs\nvar jobSettings = ExportJobSettingsBuilder.Create()\n    .WithExportSourceSettings(exportSourceSettings =\u003e // Export Source Settings\n        exportSourceSettings.FromSavedSearch(exportSourceArtifactID: savedSearchID)\n            .WithDefaultStartAtDocumentNumber())\n    .WithExportArtifactSettings(artifactSettings =\u003e\n    // ...\n    .Build();\n```\n\n## General flow description\n\n1. **Create Export Job** \u003cbr\u003e\n   Creates export job entity in particular workspace. Job is defined by its unique Id generated by user and provided in the request which is used in the next steps.\n\n2. **Start Export Job** \u003cbr\u003e\n   Starts Export Job which enables the process that schedules export data from workspace based on the configuration assigned in previous step.\n\n3. **(Optional) Cancel Export Job** \u003cbr\u003e\n   If the job is running, you can cancel it.\n\n4. **Check Export Job status** \u003cbr\u003e\n   You can check the status of the export job, it will indicate whenever it failed, was completed or is still running.\n\n## Example of simple export job flow\n\nExporting native files from folder.\n\n1. Create configuration\n   \u003e C# Builders\n\n```cs\n// Workspace ID.\nint workspaceID = 1020245;\n\n// View ID.\nint viewID = 1042326;\n\n// Folder ID.\nint folderID = 1003697;\n\n// Job related data\nGuid jobID = Guid.NewGuid();\nstring? applicationName = \"Export-Service-Sample-App\";\nstring? correlationID = \"Sample-Job\";\n\n// Export source settings\nvar sourceSettings = ExportSourceSettingsBuilder.Create()\n    .FromFolder(exportSourceArtifactID: folderID, viewID: viewID)\n    .WithCustomStartAtDocumentNumber(1)\n    .Build();\n\n// Artifact settings\nvar artifactSettings = ExportArtifactSettingsBuilder.Create()\n    .WithDefaultFileNamePattern()\n    .WithoutApplyingFileNamePatternToImages()\n    .WithoutExportingImages()\n    .WithoutExportingFullText()\n    .ExportNative(settings =\u003e settings.WithNativePrecedenceArtifactIDs(new List\u003cint\u003e { -1 })) // Exports only native files\n    .WithoutExportingPdf()\n    .WithFieldArtifactIDs(new List\u003cint\u003e { 1003676, 1003667 }) // Fields to export\n    .WithoutExportingMultiChoicesAsNested()\n    .Build();\n\n// Subdirectory settings\nvar subdirectorySettings = SubdirectorySettingsBuilder.Create()\n    .WithSubdirectoryStartNumber(1)\n    .WithMaxNumberOfFilesInDirectory(100)\n    .WithDefaultPrefixes()\n    .OverridePrefixDefaults(prefixes =\u003e\n    {\n        prefixes.NativeSubdirectoryPrefix = \"Native_\";\n    })\n    .WithSubdirectoryDigitPadding(5)\n    .Build();\n\n// Volume settings\nvar volumeSettings = VolumeSettingsBuilder.Create()\n    .WithVolumePrefix(\"VOL_FOLDER_\")\n    .WithVolumeStartNumber(1)\n    .WithVolumeMaxSizeInMegabytes(100)\n    .WithVolumeDigitPadding(5)\n    .Build();\n\n// Loadfile settings\nvar loadfileSettings = LoadFileSettingsBuilder.Create()\n    .WithoutExportingMsAccess()\n    .WithoutCustomCultureInfo()\n    .WithLoadFileFormat(LoadFileFormat.CSV)\n    .WithEncoding(\"UTF-8\")\n    .WithImageLoadFileFormat(ImageLoadFileFormat.IPRO)\n    .WithPdfFileFormat(PdfLoadFileFormat.IPRO_FullText)\n    .WithDelimiterSettings(delimiters =\u003e\n        delimiters.WithDefaultDelimiters())\n    .Build();\n\n// Output settings\nvar outputSettings = ExportOutputSettingsBuilder.Create()\n    .WithoutArchiveCreation()\n    .WithDefaultFolderStructure()\n\t.WithoutTransferJobID()\n    .WithDefaultDestinationPath()\n    .WithSubdirectorySettings(subdirectorySettings)\n    .WithVolumeSettings(volumeSettings)\n    .WithLoadFileSettings(loadfileSettings)\n    .Build();\n\n// Connect all settings in the Job builder\nvar jobSettings = ExportJobSettingsBuilder.Create()\n    .WithExportSourceSettings(sourceSettings)\n    .WithExportArtifactSettings(artifactSettings)\n    .WithExportOutputSettings(outputSettings)\n    .Build();\n```\n\n\u003e C#\n\n```cs\n// Workspace ID.\nint workspaceID = 1020245;\n\n// View ID.\nint viewID = 1042326;\n\n// Folder ID.\nint folderID = 1003697;\n\n// Job related data\nGuid jobID = Guid.NewGuid();\nstring? applicationName = \"Export-Service-Sample-App\";\nstring? correlationID = \"Sample-Job\";\n\nvar sourceSettings = new ExportSourceSettings()\n{\n    ArtifactTypeID = 10,\n    ExportSourceArtifactID = folderID,\n    ExportSourceType = ExportSourceType.Folder,\n    ViewID = viewID,\n    StartAtDocumentNumber = 1\n};\n\nvar artifactSettings = new ExportArtifactSettings()\n{\n    FileNamePattern = \"{identifier}\",\n    ApplyFileNamePatternToImages = false,\n    ExportFullText = false,\n    ExportImages = false,\n    ExportNative = true,\n    ExportPdf = false,\n    FieldArtifactIDs = new List\u003cint\u003e() { 1003676, 1003667 },\n    NativeFilesExportSettings = new NativeFilesExportSettings()\n    {\n        NativePrecedenceArtifactIDs = new List\u003cint\u003e() { -1 }\n    },\n    ExportMultiChoicesAsNested = false\n};\n\nvar subdirectorySettings = new SubdirectorySettings()\n{\n    SubdirectoryStartNumber = 1,\n    MaxNumberOfFilesInDirectory = 100,\n    FullTextSubdirectoryPrefix = String.Empty,\n    ImageSubdirectoryPrefix = String.Empty,\n    NativeSubdirectoryPrefix = \"Native_\",\n    PdfSubdirectoryPrefix = String.Empty,\n    SubdirectoryDigitPadding = 5\n};\n\nvar volumeSettings = new VolumeSettings()\n{\n    VolumePrefix = \"VOL_FOLDER_\",\n    VolumeStartNumber = 1,\n    VolumeMaxSizeInMegabytes = 100,\n    VolumeDigitPadding = 5\n};\n\nvar loadfileSettings = new LoadFileSettings()\n{\n    ExportMsAccess = false,\n    CultureInfo = \"en-US\",\n    LoadFileFormat = LoadFileFormat.CSV,\n    Encoding = \"UTF-8\",\n    ImageLoadFileFormat = ImageLoadFileFormat.IPRO,\n    PdfLoadFileFormat = PdfLoadFileFormat.IPRO_FullText,\n    DelimitersSettings = new DelimitersSettings()\n    {\n        MultiRecordDelimiter = (char)059,\n        NestedValueDelimiter = (char)092,\n        NewlineDelimiter = (char)174,\n        QuoteDelimiter = (char)254,\n        RecordDelimiter = (char)020\n    }\n};\n\nvar outputSettings = new ExportOutputSettings()\n{\n    CreateArchive = false,\n    SubdirectorySettings = subdirectorySettings,\n    LoadFileSettings = loadfileSettings,\n    VolumeSettings = volumeSettings\n};\n\nvar jobSettings = new ExportJobSettings()\n{\n    ExportArtifactSettings = artifactSettings,\n    ExportOutputSettings = outputSettings,\n    ExportSourceSettings = sourceSettings\n};\n```\n\n\u003e JSON\n\n```json\n{\n  \"ExportSourceSettings\": {\n    \"ArtifactTypeID\": 10,\n    \"ExportSourceType\": 2,\n    \"ExportSourceArtifactID\": 1003697,\n    \"ViewID\": 1042326,\n    \"StartAtDocumentNumber\": 1\n  },\n  \"ExportArtifactSettings\": {\n    \"FileNamePattern\": \"{identifier}\",\n    \"ApplyFileNamePatternToImages\": false,\n    \"ExportNative\": true,\n    \"ExportPdf\": false,\n    \"ExportImages\": false,\n    \"ExportFullText\": false,\n    \"ExportMultiChoicesAsNested\": false,\n    \"ImageExportSettings\": null,\n    \"FullTextExportSettings\": null,\n    \"NativeFilesExportSettings\": {\n      \"NativePrecedenceArtifactIDs\": [-1]\n    },\n    \"FieldArtifactIDs\": [1003676, 1003667]\n  },\n  \"ExportOutputSettings\": {\n    \"LoadFileSettings\": {\n      \"LoadFileFormat\": 1,\n      \"ImageLoadFileFormat\": 1,\n      \"PdfLoadFileFormat\": 2,\n      \"Encoding\": \"UTF-8\",\n      \"DelimitersSettings\": {\n        \"NestedValueDelimiter\": \"\\\\\",\n        \"RecordDelimiter\": \"\\u0014\",\n        \"QuoteDelimiter\": \"\\u00FE\",\n        \"NewlineDelimiter\": \"\\u00AE\",\n        \"MultiRecordDelimiter\": \";\"\n      },\n      \"ExportMsAccess\": false,\n      \"CultureInfo\": null\n    },\n    \"VolumeSettings\": {\n      \"VolumePrefix\": \"VOL_FOLDER_\",\n      \"VolumeStartNumber\": 1,\n      \"VolumeMaxSizeInMegabytes\": 100,\n      \"VolumeDigitPadding\": 5\n    },\n    \"SubdirectorySettings\": {\n      \"SubdirectoryStartNumber\": 1,\n      \"MaxNumberOfFilesInDirectory\": 100,\n      \"ImageSubdirectoryPrefix\": \"\",\n      \"NativeSubdirectoryPrefix\": \"Native_\",\n      \"FullTextSubdirectoryPrefix\": \"\",\n      \"PdfSubdirectoryPrefix\": \"\",\n      \"SubdirectoryDigitPadding\": 5\n    },\n    \"CreateArchive\": false,\n    \"FolderStructure\": 0,\n    \"DestinationPath\": null\n  }\n}\n```\n\n2. Create export job\n   \u003e .NET Kepler\n\n```cs\nusing Relativity.Export.V1.IExportJobManager jobManager = serviceFactory.CreateProxy\u003cRelativity.Export.V1.IExportJobManager\u003e();\n\nvar validationResult = await jobManager.CreateAsync(\n    workspaceID,\n    jobID,\n    jobSettings,\n    applicationName,\n    correlationID);\n```\n\n3. Start export job\n   \u003e .NET Kepler\n\n```cs\n// Start export job\nvar startResponse = await jobManager.StartAsync(workspaceID, jobID);\n\n// Check for errors that occured during job start\nif (!string.IsNullOrEmpty(startResponse.ErrorMessage))\n{\n    _logger.LogError($\"\u003c{startResponse.ErrorCode}\u003e {startResponse.ErrorMessage}\");\n    // ...\n}\n```\n\n4. Check export job status\n   \u003e .NET Kepler\n\n```cs\ndo\n{\n    var status = await jobManager.GetAsync(workspaceID, jobID);\n    Console.WriteLine($\"Job status: {status.Value.JobStatus}\");\n} while (jobStatus?.Value.JobStatus is not ExportStatus.Completed\n    and not ExportStatus.CompletedWithErrors\n    and not ExportStatus.Failed\n    and not ExportStatus.Cancelled);\n```\n\n## Export Job States\n\n| Value | State               | Description                                                                                                                                                 |\n| ----- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| 0     | New                 | Export job created but not started yet.                                                                                                                     |\n| 1     | Scheduled           | Export job scheduled and waiting for an agent.                                                                                                              |\n| 2     | Running             | Job executing, export of data is currently in progress.                                                                                                     |\n| 3     | Completed           | Export job completed. All records processed without errors.                                                                                                 |\n| 4     | CompletedWithErrors | Export job completed with some errors. All records processed but one or more item level errors occurred.                                                    |\n| 5     | Failed              | Export job failed with a fatal error. Not all records were processed.                                                                                       |\n| 6     | Cancelled           | Job cancelled by user.                                                                                                                                      |\n| 7     | Transferring        | Export from Relativity to Transfer Service location completed. The transfer job is in progress, and export results are syncing to the destination location. |\n\n## Error Codes\n\nError handling in Export Service returns Error Codes and Error Messages:\n\n- in every response for failed HTTP request\n- when requested by user for all item errors that occurred during export of particular data source\n\n### Error code structure\n\nError code structure\nError code returned from the Export Service API endpoint has the following structure:\n\n**`[Source].[ErrorType].[Operation].[ErrorNumber]`**\n\nExamples:\n\n| Error code | Description                            |\n| ---------- | -------------------------------------- |\n| JOB.01     | Incorrect total items processed number |\n\n\u003e Sources\n\n| Source | Description   |\n| ------ | ------------- |\n| JOB    | Jobs          |\n| CONF   | Configuration |\n| EXT    | External      |\n| ITEM   | Item          |\n| MES    | Message       |\n| IO     | Input/Output  |\n\n\u003e Error Types\n\n| Type | Description               |\n| ---- | ------------------------- |\n| GET  | Receiving data            |\n| CRE  | Creatiing                 |\n| IMG  | Image file                |\n| PDF  | PDF file                  |\n| MSA  | MsAccess                  |\n| PRO  | Production                |\n| LFL  | Main load file            |\n| SCH  | Scheduling                |\n| TS   | Transfer service          |\n| OM   | Object manager            |\n| SQL  | Structured Query Language |\n| FS   | Folder service            |\n| DG   | Data grid                 |\n| DATA | Corrupted data            |\n| VLD  | Validation                |\n\n\u003e Operations\n\n| Operation | Description |\n| --------- | ----------- |\n| GET       | Get         |\n| COPY      | Copy        |\n| SAVE      | Save        |\n| DELETE    | Delete      |\n| CHECK     | Check       |\n\n# Samples\n\nThere are two types of sample application that demonstrate the use of Export Service API features.\n\n- `RelConsole` - .NET console application (.NET 6, C#, Kepler Client).\n- `Powershell` - Powershell scripts.\n\n## List of samples\n\n| Sample Name                        | .NET \u0026 Kepler                                                                                                                                                            | Powershell                                                                                                                                                                  |\n| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Export_FromFolder_NativeFiles      | [Sample 1](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_NativeFiles.cs)      | [Sample 1](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-native-files.ps1)       |\n| Export_FromFolder_Images           | [Sample 2](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_Images.cs)           | [Sample 2](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-images.ps1)             |\n| Export_FromFolder_PDF              | [Sample 3](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_PDF.cs)              | [Sample 3](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-pdf.ps1)                |\n| Export_FromFolder_FullText         | [Sample 4](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_FullText.cs)         | [Sample 4](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-full-text.ps1)          |\n| Export_FromFolder_All              | [Sample 5](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_All.cs)              | [Sample 5](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-all.ps1)                |\n| Export_FromSavedSearch_NativeFiles | [Sample 6](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_SavedSearch_NativeFiles.cs) | [Sample 6](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-saved-search-native-files.ps1) |\n| Export_FromSavedSearch_Images      | [Sample 7](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_SavedSearch_Images.cs)      | [Sample 7](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-saved-searchimages.ps1)        |\n| Export_FromSavedSearch_PDF         | [Sample 8](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_SavedSearch_PDF.cs)         | [Sample 8](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-saved-search-pdf.ps1)          |\n| Export_FromSavedSearch_FullText    | [Sample 9](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_SavedSearch_FullText.cs)    | [Sample 9](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-saved-search-full-text.ps1)    |\n| Export_FromSavedSearch_All         | [Sample 10](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_SavedSearch_All.cs)        | [Sample 10](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-saved-search-alls.ps1)        |\n| Export_FromProduction_NativeFiles  | [Sample 11](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Production_NativeFiles.cs) | [Sample 11](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-production-native-files.ps1)  |\n| Export_FromProduction_Images       | [Sample 12](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Production_Images.cs)      | [Sample 12](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-production-images.ps1)        |\n| Export_FromProduction_PDF          | [Sample 13](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Production_PDF.cs)         | [Sample 13](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-production-pdf.ps1)           |\n| Export_FromProduction_Fulltext     | [Sample 14](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Production_FullText.cs)    | [Sample 14](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-production-full-text.ps1)     |\n| Export_FromProduction_All          | [Sample 15](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Production_All.cs)         | [Sample 15](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-production-all.ps1)           |\n| Export_RDO                         | [Sample 16](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_RDO.cs)                    | [Sample 16](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-rdo.ps1)                      |\n| Job_ListExportJobs                 | [Sample 17](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Job_List.cs)                      | [Sample 17](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/job-list.ps1)                        |\n| Job_StartAllRunnableJobs           | [Sample 18](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Job_StartAllRunnableJobs.cs)      | [Sample 18](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/job-start-all-runnable-jobs.ps1)     |\n| Job_GetSettings                    | [Sample 19](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Job_GetSettings.cs)               | [Sample 19](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/job-get-settings.ps1)                |\n| Job_Cancel                         | [Sample 20](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Job_Cancel.cs)                    | [Sample 20](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/job-cancel.ps1)                      |\n\n## Kepler Samples\n\nTo run the sample code:\n\n1. Replace the variables with your url and credentials in `Program.cs`.\n\n```cs\nusing System.Text;\nusing Relativity.Export.Samples.RelConsole.Helpers;\n\nSystem.Console.OutputEncoding = Encoding.UTF8;\nSystem.Console.InputEncoding = Encoding.UTF8;\n\n// Replace with your Relativity instance url\nstring relativityUrl = \"http://host/\";\n\n// Replace with your Relativity credentials\nstring username = \"username\";\nstring password = \"password\";\n\nawait OutputHelper.StartAsync(args, relativityUrl, username, password);\n```\n\n2. Replace the required variables within the samples\u003cbr\u003e\n   For example in [Export_FromFolder_NativeFiles](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.RelConsole/SampleCollection/Export_Folder_NativeFiles.cs) sample replace\n\n```cs\n// ...\n// with your workspace ID\nint workspaceID = 1020245;\n// with your view ID\nint viewID = 1042326;\n// with your folder ID\nint folderID = 1003697;\n// with your field artifact IDs\n    .WithFieldArtifactIDs(new List\u003cint\u003e { 1003676, 1003667 })\n// ...\n```\n\n3. Run the sample via `dotnet run {selectedSampleID}` command. \u003cbr\u003e\n   Arguments:\n   - `{selectedSampleID}` - ID of the sample to run.\n   - `-json` - appends additional json details to the sample output.\n   - `-noui` - disables some UI elements on the initial screen\n\nExample:\n\n\u003e Runnnig sample with ID 1 and appending json details to the output\n\n```bash\ndotnet run 1 -json\n```\n\nExample:\n\n\u003e Showing the sample list\n\n```bash\ndotent run\n```\n\n## Powershell Samples\n\nTo run a sample code:\n\n- Install Powershell \"Pester\" Module (ver. \u003e= 5.3.3)\n\n       Find-Module -Name \"Pester\" | Install-Module -Force;\n\n- Uncomment line with sample invocation you want to run in [run-sample-export.ps1](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/SamplesCollection/export-folder-all.ps1).\n\n        Describe \"Sample export\" {\n        . \"$global:rootDir\\SamplesCollection\\export-folder-all.ps1\"\n\n        # . \"$global:rootDir\\SamplesCollection\\export-folder-full-text.ps1\"\n\n- Set the proper credentials and host address of your Relativity instance in \"run-sample-export.ps1\".\n\n        $hostAddress = \"https://sample-host/\"\n        $userName = \"sample@username\"\n        $password = \"password!\"\n\n- Replace required variables within the sample. It is required in each sample.\n  Example in [export-folder-all.ps1](https://github.com/relativitydev/relativity-export-samples/blob/main/Relativity.Export.Samples.Powershell/run-sample-export.ps1) sample replace\n\n      # ...\n      # Your workspace ID: this is where we point to the workspace where we want to export from\n      [int]$workspaceId = 1022188\n\n      # Export settings parameters\n      # Your view ID: view will provide us with available data to export, requires folder to be visible there.\n      # Your folder ID: our targetted folder. If you want to export from the workspace root, the ID is different from the workspace ID.\n      # ExportSourceType: ExportFolder or ExportFolderWithSubfolders\n      [int]$viewId = 1003684\n      [int]$folderID = 1003697\n      [bool]$withSubfolders = $true\n\n      # ArtifactIds: Example: 1003668 - Extracted Text, 1003677 - Folder Name, 1003676 - Artifact ID, 1003667 - Control Number\n      $fulltextPrecedenceFieldsArtifactIds = '[1003668,1003677]'\n      $fieldArtifactIds = '[1003676,1003667]'\n      #...\n\n- Invoke run-sample-export.ps1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelativitydev%2Frelativity-export-samples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frelativitydev%2Frelativity-export-samples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frelativitydev%2Frelativity-export-samples/lists"}