Warning

This API is outdated. Visit Ecrion Develop API 12.0 to access the latest version of the Ecrion API.

Ecrion 11.5 Develop API Guide

This guide will walk a customer through the available Application Programming Interfaces (API v2) endpoints for the Develop solution of the Ecrion Platform version 11.5 (Mantine) and later.

Introducing Ecrion API 2

Using this API, software programmers are able to produce documents in high volumes and manage customer communications, according to the different Ecrion layers.

Ecrion Develop

Ecrion provides the following APIs:

Notes

The communication between these APIs and the Ecrion server is performed through REST endpoints via HTTP or HTTPS.

  • For Ecrion Develop (core-only) installations, the ports default to 50100 (HTTP) and 50101 (HTTPS).
  • In the cloud however, only HTTPS (port 443) access is provided.
  • Live REST API Documentation

    The REST API is accompanied by a live documentation page which allows you to send requests in real time and examine the response.

    The Live REST API Inspector can be accessed via a web page under the /doc URL. For a local installation using the default ports, this would be:

    The default ports can be updated from the Management Console tool, by going to the Engine Settings\HTTP Server Configuration and updating the HTTP Server Port parameter, respectively HTTPS Server Port.

    Getting Started

    Authentication

    Ecrion uses API keys in order to authenticate requests made by clients. You have to access the Management Console to find the API Key in order to use the Ecrion Develop API.

    For core-only installations, open the Management Console, and navigate to Ecrion Develop Engine/Engine Settings/HTTP Server Configuration/API KEY. If you are using the cloud version, these can be downloaded from the Developer\Software module, under the Programming tools and API's group section.

    All endpoints require a session token. The token can be obtained using the Authorization service.

    Template management

    For core-only installations, templates are managed in the file system and can be found in the Management Console/Workspaces, under the default workspace. XML Document samples can be found in Start Menu under Ecrion Develop Samples then access XML Samples. You can find here samples that prove the basic conversion capabilities of out Ecrion Develop tool: Ecrion Studio Publisher templates and XSL-FO files for XML to PDF conversion, and also DAL files use for document assembly.

    Using Ecrion JavaScript API

    Including the library

    The Javascript API is referenced through Ecrion.EOS.Client.2.0.js. Use https://eos4.ecrion.com as the server name, however for core-only installations, make sure to use the correct server name and port number provided by your system administrator:

    <html>
        <head>
            <script src="https://eos4.ecrion.com/sdk/v2/javascript/Ecrion.EOS.Client.2.0.js"></script>
        </head>
    <body>
        <script>
        // Javascript code that uses the Ecrion API
        </script>
    </body>
    </html>
    

    Using the API

    The example below uses JavaScript to convert XML to PDF using a template stored on the Ecrion server. An XML string is sent to the Ecrion server and a PDF is received back:

    // Wait for the API to initialize
    eosAPI.ready(function(){
        // Authenticate using an API key
        eosAPI.authorize("API:59e80576-19e5-4808-98c0-cf2c9da055ea")
        .catch(function(response){
            // Handle any authentication errors here
            alert("Authentication failure: " + response.statusText);
        })
    });
    // Wait for authorize() to complete
    eosAPI.authorized(function(){
        // Render an xml to pdf using a template
        eosAPI.DirectRender.Render({
            request: {
                InputSettings: {
                    Template: {
                        Workspace: "Default",
                        Path: "Retail/Bookstore Invoice/Invoice.epr"
                    }
                },
                Input: {
                    InputFormat: "xml",
                    Source: '<?xml version="1.0" standalone="yes"?>' +
                        '<root>' +
                            '<Invoices>' +
                                '<Invoice>' +
                                    '<InvoiceProperties>' +
                                        '<number>02116</number>' +
                                        '<date>2016-06-10</date>' +
                                    '</InvoiceProperties>' +
                                    '<CustomerInformation>' +
                                        '<name>Earl Library Co.</name>' +
                                        '<address>1021 South Main Street, Seattle, Washington 92315</address>' +
                                        '<email>sales@earlbook.com</email>' +
                                        '<telephone>(206)321-2345</telephone>' +
                                    '</CustomerInformation>' +
                                    '<Products>' +
                                        '<Product>' +
                                            '<id>1</id>' +
                                            '<name>Rendezvous with Rama by Arthur C. Clarke</name>' +
                                            '<price>15</price>' +
                                            '<quantity>3</quantity>' +
                                            '<total>45</total>' +
                                            '<description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke\'s best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description>' +
                                        '</Product>' +
                                    '</Products>' +
                                    '<Comments>' +
                                        '<comments>Contact us with any questions you may have.</comments>' +
                                    '</Comments>' +
                                '</Invoice>' +
                            '</Invoices>' +
                        '</root>'
                },
                PdfOutput: {}
            }
        }, {
            responseContentType: 'application/pdf'
        })
        .then(function(response) {
            // PDF rendered and received. You can use response.data to retrieve the PDF bytes, 
            // however for this sample the previewResponse utility is used 
            // to quickly preview the response bytes in a new window
            eosAPI.Util.previewResponse(response);
        })
        .catch(function(response){
            // Handle any render errors here
            alert("Render error: " + response.obj.Message);
        });
    });
    

    Notes

  • The Ecrion JavaScript API uses Promises.
  • The response's obj property contains the deserialized response.
  • The response's data property contains the response bytes if it's binary.
  • The response's status property contains the HTTP status code.
  • Before using the API you must wait for it to become ready either by using .ready or .authorized wrappers.
  • If you're getting the sessionToken using your own backend you can use .authorizeWithToken utility instead of authorize.
  • After authorization is complete, the session token is available via eosAPI.sessionToken.
  • Using Ecrion .NET API

    Downloading the API

    For core-only installations, use the SDK download page, which by default is located at https://localhost:50101/sdk or http://localhost:50100/sdk.

    If you are using the cloud version, these can be downloaded from the Developer\Software module, under the Programming tools and API's group section.

    Using the API

    In the zip file there is a README.html file that explains how to use the API.

    For core-only installations, you need to make sure to use the correct server name and port number provided by your system administrator:

    The code sample below uses Ecrion API to convert XML to PDF using a template stored on the Ecrion server. An XML string is sent to the Ecrion server and a PDF is received back and downloaded locally.

    string eosUrl = "https://eos4.ecrion.com";
    string apiKey = "API:59e80576-19e5-4808-98c0-cf2c9da055ea";
    string downloadFolder = "C:/Downloads/";
    string fileName = "eos-sample1-xml2pdf.pdf";
    
    try
    {
        AuthorizationService authSvc = new AuthorizationService(eosUrl);
        string sessionToken = authSvc.GetToken(apiKey).AccessToken;
        Console.WriteLine("Your token is: {0}", sessionToken);
    
        // Render XML -> PDF
        // Create a new Render API
        DirectRenderService renderSvc = new DirectRenderService(eosUrl);
    
        // Create a new render request
        RenderRequestEntity request = new RenderRequestEntity()
        {
            InputSettings = new InputSettings()
            {
                Template = new Template()
                {
                    Workspace = "Default",
                    Path = "Retail/Bookstore Invoice/Invoice.epr"
                }
            },
            Input = new Input()
            {
                InputFormat = "xml",
                Source = "<?xml version=\"1.0\" standalone=\"yes\"?>" +
                    "<root>" +
                        "<Invoices>" +
                            "<Invoice>" +
                                "<InvoiceProperties>" +
                                    "<number>02116</number>" +
                                    "<date>2016-06-10</date>" +
                                "</InvoiceProperties>" +
                                "<CustomerInformation>" +
                                    "<name>Earl Library Co.</name>" +
                                    "<address>1021 South Main Street, Seattle, Washington 92315</address>" +
                                    "<email>sales@earlbook.com</email>" +
                                    "<telephone>(206)321-2345</telephone>" +
                                "</CustomerInformation>" +
                                "<Products>" +
                                    "<Product>" +
                                        "<id>1</id>" +
                                        "<name>Rendezvous with Rama by Arthur C. Clarke</name>" +
                                        "<price>15</price>" +
                                        "<quantity>3</quantity>" +
                                        "<total>45</total>" +
                                        "<description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke's best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description>" +
                                    "</Product>" +
                                "</Products>" +
                                "<Comments>" +
                                    "<comments>Contact us with any questions you may have.</comments>" +
                                "</Comments>" +
                            "</Invoice>" +
                        "</Invoices>" +
                    "</root>"
            },
            PdfOutput = new PdfOutput()
        };
    
        // Send the request
        Stream response = renderSvc.Render(sessionToken, request);
        Console.WriteLine("XML -> PDF rendered ok");
    
        // Download the PDF locally
        if (!Directory.Exists(downloadFolder))
            Directory.CreateDirectory(downloadFolder);
        using (System.IO.Stream newFile = System.IO.File.OpenWrite(downloadFolder + fileName))
        {
            response.CopyTo(newFile);
        }
    
        Console.WriteLine("Downloaded response file to folder: {0}", downloadFolder + fileName);
    }
    catch (Exception ex)
    {
        Console.WriteLine("Error: {0}", ex.Message);
    }
    

    Using Ecrion Java API

    Downloading the API

    For core-only installations, use the SDK download page, which is by default located at https://localhost:50101/sdk or http://localhost:50100/sdk.

    If you are using the cloud version, these can be downloaded from the Developer\Software module, under the Programming tools and API's group section.

    Using the API

    In the zip file there is a README.html file that explains how to use the API.

    For core-only installations, you need to make sure to use the correct server name and port number provided by your system administrator:

    The code snippet below uses Ecrion API to convert XML to PDF using a template stored on the Ecrion server. An XML string is sent to the Ecrion server and a PDF is received back:

    String eosUrl = "https://eos4.ecrion.com";
    String apiKey = "API:59e80576-19e5-4808-98c0-cf2c9da055ea";
    String downloadFolder = "C:/Downloads/";
    String fileName = "eos-sample1-xml2pdf.pdf";
    
    
    AuthorizationService authSvc = new AuthorizationService(eosUrl);
    String sessionToken = authSvc.getToken(apiKey).getAccessToken();
    System.out.format("Your token is: %s%n", sessionToken);
    
    // Create a new render request
    RenderRequestEntity renderRequest = new RenderRequestEntity();
    
    InputSettings inputSettings = new InputSettings();
    Template template = new Template();
    template.setWorkspace("Default");
    template.setPath("Retail/Bookstore Invoice/Invoice.epr");
    inputSettings.setTemplate(template);
    renderRequest.setInputSettings(inputSettings);
    
    Input input = new Input();
    input.setInputFormat("xml");
    input.setSource("<?xml version=\"1.0\" standalone=\"yes\"?>" +
            "<root>" +
                "<Invoices>" +
                    "<Invoice>" +
                        "<InvoiceProperties>" +
                            "<number>02116</number>" +
                            "<date>2016-06-10</date>" +
                        "</InvoiceProperties>" +
                        "<CustomerInformation>" +
                            "<name>Earl Library Co.</name>" +
                            "<address>1021 South Main Street, Seattle, Washington 92315</address>" +
                            "<email>sales@earlbook.com</email>" +
                            "<telephone>(206)321-2345</telephone>" +
                        "</CustomerInformation>" +
                        "<Products>" +
                            "<Product>" +
                                "<id>1</id>" +
                                "<name>Rendezvous with Rama by Arthur C. Clarke</name>" +
                                "<price>15</price>" +
                                "<quantity>3</quantity>" +
                                "<total>45</total>" +
                                "<description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke's best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description>" +
                            "</Product>" +
                        "</Products>" +
                        "<Comments>" +
                            "<comments>Contact us with any questions you may have.</comments>" +
                        "</Comments>" +
                    "</Invoice>" +
                "</Invoices>" +
            "</root>");
    renderRequest.setInput(input);
    
    renderRequest.setPdfOutput(new PdfOutput());
    
    DirectRenderService renderSvc = new DirectRenderService(eosUrl);
    
    // Send the Request
    java.io.InputStream response = renderSvc.render(sessionToken, renderRequest);
    
    // Download the PDF locally
    FileOutputStream outputFile = new FileOutputStream(downloadFolder + fileName);
    byte[] buffer = new byte[1024];
    int bytesRead = -1;
    
    java.io.BufferedInputStream bufferedReader = new java.io.BufferedInputStream(response);
    
    while ((bytesRead = bufferedReader.read(buffer, 0, 1024)) != -1) 
    outputFile.write(buffer, 0, bytesRead);
    
    response.close();
    outputFile.close();
    System.out.format("File %s downloaded ok%n", downloadFolder + fileName);
    

    Java SDK Notes

    The API Reference documents entities and methods using a simplified model. You will need to use setters and getters when working with the entities, just like it's used in the above example.

    General Notes

    Error handling

    Each API method can throw error and attempts to return appropriate HTTP status codes. Additional info is included in the body of the response, JSON-formatted.

    Example:

    //400 BadRequest
    {
        "Message": "Required parameter 'Path' not found."
    }
    
    Code Text Description
    200 OK Success!
    201 Created Resource created. Usually, the response body represents the newly created resource.
    204 No Content Request processed. Response is intentionally blank e.g. DELETE operations.
    400 Bad Request The request was invalid or cannot be otherwise served. An accompanying error message will explain further.
    401 Unauthorized Missing or incorrect credentials.
    403 Forbidden The request is understood, but it has been refused or access is not allowed. An accompanying error message will explain why. This is usually because of the current authenticated user not having permission to manage the resource.
    404 Not Found The URI requested is invalid or the resource requested, such as a user, does not exist.
    410 Gone This resource is gone. Used to indicate that an API endpoint has been turned off.
    415 Unsupported Media Type The payload is in a format not supported by this method on the target resource. The format problem might be due to the request's indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.
    500 Internal Server Error Something is broken. Additional explanation is included in the response body.

    Dates and durations

    All dates in the API are strings in the ISO 8601 DateTime format:

    "2017-01-26T11:29:35Z"
    

    All durations in the API are string in the ISO 8601 Duration format:

    "PT1.52S"
    

    API Reference

    This Enteprise API reference is organized by services and resource type. Each service groups similar resources together and has one or more methods that changes these resources (create, read, update, delete, etc.). All HTTP routes are relative to Enterprise Website base URI, e.g. api/v2/token refers to https://eos4.ecrion.com/api/v2/token.

    Authorization

    GetToken

    Generates the access token used for all API calls. Ecrion Develop

    GET /api/v2/token

    To generate an access token, call this method and supply the user credentials (case sensitive). The preferred way of authenticating is to use an API key. For more information about API keys, see Authentication.

    The response contains an access token that needs to be passed via Authorization header using Basic <sessionTokenInbase64> format in order to authorize a generic endpoint. If you're using our Javascript, .NET or Java client API this process is simplified (examples below).

    Parameters

    Returns TokenEntity

    Examples

    Javascript

    If you're running Javascript inside a browser, you should avoid typing the credentials in plain text because the .js sources are available to the client. Instead, it is preferred to store the API Key on your server and do the authentication in a secure backend, passing only a sessionToken to the client, using authorizeWithToken utility.

    eosAPI.ready(function(){
        var sessionToken = obtainTokenFromMyBackend();
        eosAPI.authorizeWithToken(sessionToken);
        //all subsequent eosAPI calls will use the sessionToken
    })
    

    However, if you're using Javascript in a server-side environment or the credentials are provided by the client user, the authorize utility method is available. Internally, it calls Auth.GetToken and uses the returned access token for all subsequent calls through the eosAPI global instance:

    var apiKey = "API:dee401eb-d3e5-4523-9f90-c19a573e7e0a";
    eosAPI.authorize(apiKey)
    .catch(function(response){
        // Handle any authentication errors here
        alert("Authentication failure: " + err.statusText);
    });
    eosAPI.authorized(function(){
        //all eosAPI calls will use the sessionToken obtained based on the apiKey
    });
    

    The authorize method supports passing two arguments, i.e. eosAPI.authorize(username, password) if you want to use a username/password combination.

    If credentials are used on multiple environments, the environment name is required

    For example → eosAPI.authorize(username, password, environment).

    .NET

    string apiKey = "API:dee401eb-d3e5-4523-9f90-c19a573e7e0a";
    AuthorizationService authSvc = new AuthorizationService("https://eos4.ecrion.com/");
    string sessionToken = authSvc.GetToken(apiKey).AccessToken;
    

    Alternatively, it's possible to use a username/password combination to authenticate.

    For example → authSvc.GetToken(username + ":" + password)

    If credentials are used on multiple environments, the environment name is required to authenticate.

    For example → authSvc.GetToken(environment + "#" + username + ":" + password)

    Java

    String apiKey = "API:dee401eb-d3e5-4523-9f90-c19a573e7e0a";
    AuthorizationService authSvc = new AuthorizationService("https://eos4.ecrion.com/");
    String sessionToken = authSvc.getToken(apiKey);
    

    Alternatively, it's possible to use a username/password combination to authenticate:

    For example → authSvc.getToken(username + ":" + password)

    If credentials are used on multiple environments, the environment name is required to authenticate:

    For example → authSvc.GetToken(environment + "#" + username + ":" + password)

    HTTP

    curl -X GET --header "Accept: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/token"
    

    Alternatively, it's possible to use a username/password combination to authenticate. Replace -u apiKey: with -u username:password

    If credentials are used on multiple environments, the environment name is required to authenticate. Replace -u apiKey: with -u environment#username:password


    Repository

    Ecrion Repository stores all assets involved in document production (images, templates, stylesheets, etc.) in a file repository. The Ecrion core-only installation provides a basic level of functionality, while the complete installation comes with a high performance repository capable of sustaining 1000s of read/write operations per second, versioning and dependency tracking.

    Methods:

    Entities:

    DownloadFile

    Download a file from Ecrion Develop workspace. Ecrion Develop

    GET /api/v2/files/content

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.Repository.DownloadFile({
        workspace: "Monthly Statement",
        path: "/Monthly Statement"
    })
    .then(function(response) {
        var content = response.data;
    })
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    Stream content = repo.DownloadFile(token, "Monthly Statement", "/Monthly Statement");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.io.InputStream content = repo.downloadFile(token, "Monthly Statement", "/Monthly Statement");
    

    HTTP

    curl -X GET --header "Accept: application/octet-stream" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/files/content?workspace=Default&path=%5CBookstore%20Invoice%5CInvoice.dal"
    

    __

    UploadFile

    Upload a local file to a Ecrion Develop Workspace. Ecrion Develop

    POST /api/v2/files/content

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.Repository.UploadFile({
        workspace: "Monthly Statement",
        path: "/Monthly Statement/Sample.xml",
        file: new File(['<?xml version=\"1.0\" standalone=\"yes\"?><root></root>'], "Sample.xml", {type: "text/xml"})
    })
    .then(function(response) {
        var file = response.obj;
    });
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    using (FileStream fsSource = new FileStream(@"C:\Sample.xml", FileMode.Open, FileAccess.Read))
    {
        RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
        FileEntity fileResponse = repo.UploadFile(token, "Monthly Statement", "/Monthly Statement/Sample.xml", fsSource);
    }
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.io.InputStream fsSource = new FileInputStream("C:\\Sample.xml");       
    repo.uploadFile(token, "Monthly Statement", "/Monthly Statement/Sample.xml", fsSource);
    

    HTTP

    curl -X POST -F "file=@C:\Temp\Invoice.epr" -u "TOKEN:7a6961b5-5be4-4318-b82e-4631659efa38" "http://localhost:50100/api/v2/files/content?workspace=Default&path=Bookstore%20Invoice/Invoice.epr"
    

    __

    GetFiles

    Returns a list of files from the specified parent path and an workspace. Ecrion Develop

    GET /api/v2/files

    Parameters

    Notes

    If the path is a file the result will contain a list of one file metadata from the specified file path.

    Returns FileEntity[]

    Examples

    Javascript

    // List all files in Bookstore Invoice folder
    eosAPI.Repository.GetFiles({
        workspace: "Monthly Statement",
        path: "/Translatione"
    })
    .then(function(response) {
        var files = response.obj;
    })
    

    .NET

    // List all files in Bookstore Invoice folder
    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    List<FileEntity> files = repo.GetFiles(token, "Monthly Statement", "/Translation");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.util.List<FileEntity> files = repo.getFiles(token, "Monthly Statement", "/Translation", 0, 10);
    

    HTTP

    curl -X GET --header "Accept: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/files?workspace=Default&path=%5CBookstore%20Invoice"
    

    __

    UpdateFile

    Rename, copy or move a file Ecrion Develop

    PUT /api/v2/files

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.Repository.UpdateFile({
        workspace: "Monthly Statement",
        path: "\MonthlyStatement.epr",
        fileOperation:{
            path: "\MonthlyStatement2.epr",
            action: "copy"
        }
    })
    .then(function(response) {
        var status = response.status;
    });
    

    .NET

    //duplicate MonthlyStatement.epr as MonthlyStatement2.epr
    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    repo.UpdateFile(token, "Monthly Statement", "/MonthlyStatement.epr",
        new FileOperationEntity()
        {
            Path = "/MonthlyStatement2.epr",
            Action = "copy"
        });
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    FileOperationEntity op = new FileOperationEntity();
    op.setPath("/MonthlyStatement2.epr");
    op.setAction("copy");
    op.setOverwrite(true);
    repo.updateFile(token, "Monthly Statement", "/MonthlyStatement.epr", op);
    

    HTTP

    curl -X PUT --header "Content-Type: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" -d "{
      \"Path\": \"\Bookstore Invoice\Invoice000.dal\",
      \"Action\": \"copy\",
      \"Overwrite\": true
    }" "http://localhost:50100/api/v2/files?workspace=Default&path=%5CBookstore%20Invoice%5CInvoice.dal"
    

    __

    DeleteFile

    Delete a file from Ecrion repository. Ecrion Develop

    DELETE /api/v2/files

    Parameters

    Returns

    Examples

    Javascript

    
    eosAPI.Repository.DeleteFile({
        workspace: "Monthly Statement",
        path: "\MonthlyStatement.epr",
    })
    .then(function(response) {
        var status = response.status;
    });
    
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    repo.DeleteFile(token, "Monthly Statement", "/Monthly Statement");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    repo.deleteFile(token, "Monthly Statement", "\MonthlyStatement.epr");
    

    HTTP

    curl -X DELETE --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/files?workspace=Default&path=%5CBookstore%20Invoice%5CInvoice.epr"
    

    __

    ExportFolder

    Download a zip file of a folder from Ecrion repository. Ecrion Develop

    GET /api/v2/folders/content

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.Repository.ExportFolder({
        workspace: "Monthly Statement",
        path: "/Translation"
    })
    .then(function(response) {
        // zip is a blob
        var zip = response.data;
    });
    

    .NET

    // Export Bookstore Invoice folder
    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    Stream zip = repo.ExportFolder(token, "Monthly Statement", "/Translation");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.io.InputStream zip  = repo.exportFolder(token, "Monthly Statement", "/Translation");
    

    HTTP

    curl -X GET --header "Accept: application/octet-stream" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/folders/content?workspace=Default&path=%5CBookstore%20Invoice"
    

    __

    ImportFolder

    Decompress an archive and uploads its content to Ecrion repository. Ecrion Develop

    POST /api/v2/folders/content

    Parameters

    Returns

    Examples

    Javascript

    //Upload generated .zip file
    eosAPI.Repository.ImportFolder({
        workspace: "Monthly Statement",
        path: "/Translation",
        file: new File([/*content*/ ], "myFolder.zip")
    })
    .then(function(response) {
         var folder = response.obj;
    })
    
    

    .NET

    // Import 'myFolder' to Bookstore Invoice folder
    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    using (FileStream fsSource = new FileStream(@"C:\myFolder.zip", FileMode.Open, FileAccess.Read))
    {
        RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
        FolderEntity folder = repo.ImportFolder(token, "Monthly Statement", "/Translation", false, fsSource);
    }
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.io.InputStream fsSource = new FileInputStream("C:\\myFolder.zip");
    repo.importFolder(token, "Monthly Statement", "/Translation", false, fsSource);
    

    HTTP

    curl -u "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80:" -F filedata=@"C:\myFolder.zip" "http://localhost:50100/api/v2/folders/content?workspace=Default&path=%5CBookstore%20Invoice%5CTest"
    

    __

    CreateFolder

    Create new folder Ecrion Develop

    POST /api/v2/folders

    Parameters

    Returns FolderEntity

    Examples

    Javascript

    eosAPI.Repository.CreateFolder({
        workspace: "Monthly Statement",
        path: "NewFolder"
    })
    .then(function(response) {
        var folder = response.obj;
    })
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    FolderEntity folder = repo.CreateFolder(token, "Monthly Statement", "NewFolder");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    FolderEntity folder = repo.createFolder(token, "Monthly Statement", "NewFolder");
    

    HTTP

    curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/folders?workspace=Default&path=%5CBookstore%20Invoice%5CTest"
    Request URL
    

    __

    GetFolders

    Returns a list of folders in the specified parent path and workspace. Ecrion Develop

    GET /api/v2/folders

    Parameters

    Returns

    Examples

    Javascript

    // List all folders from a workspace
    eosAPI.Repository.GetFolders({
        workspace: "Monthly Statement",
        path: "/Translation"
    })
    .then(function(response) {
        var folders = response.obj;
    })
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    List<FolderEntity> folders = repo.GetFolders(token, "Monthly Statement", "/Translation");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    java.util.List<FolderEntity> folders =  repo.getFolders(token, "Monthly Statement", "/Translation", 0, 10);
    

    HTTP

    curl -X GET --header "Accept: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/folders?workspace=Default&path=%5CBookstore%20Invoice"
    

    __

    DeleteFolder

    Deletes the folder. Ecrion Develop

    DELETE /api/v2/folders

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.Repository.DeleteFolder({
        workspace: "Monthly Statement",
        path: "/Translation"
    })
    .then(function(response) {
        var status = response.status;
    })
    

    .NET

    string token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    repo.DeleteFolder(token, "Monthly Statement", "/Translation");
    

    Java

    String token = "TOKEN:c87ca566-2587-4480-8a7a-27531f04af80";
    RepositoryService repo = new RepositoryService("https://eos4.ecrion.com/");
    repo.deleteFolder(token, "Monthly Statement", "/Translation");
    

    HTTP

    curl -X DELETE --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/folders?workspace=Default&path=%5CBookstore%20Invoice%5CInput"
    

    DirectRender

    Render

    Render input into a variety of output formats including PDF, Word, etc. Ecrion Develop

    POST /api/v2/render

    Parameters

    Returns

    Examples

    Javascript

    eosAPI.DirectRender.Render({
        request: {
            InputSettings: {
                Template: {
                    Workspace: "Default",
                    Path: "Retail/Bookstore Invoice/Invoice.epr"
                }
            },
            Input: {
                InputFormat: "xml",
                Source: "<?xml version=\"1.0\" standalone=\"yes\"?><root><Invoices><Invoice><InvoiceProperties><number>02116</number><date>2016-06-10</date></InvoiceProperties><CustomerInformation><name>Earl Library Co.</name><address>1021 South Main Street, Seattle, Washington 92315</address><email>sales@earlbook.com</email><telephone>(206)321-2345</telephone></CustomerInformation><Products><Product><id>1</id><name>Rendezvous with Rama by Arthur C. Clarke</name><price>15</price><quantity>3</quantity><total>45</total><description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke's best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description></Product></Products><Comments><comments>Contact us with any questions you may have.</comments></Comments></Invoice></Invoices></root>"
            },
            TxtOutput: {}
        }
    })
    .then(function(response) {
        var content = response.data;
    })
    

    .NET

    DirectRenderService renderSvc = new DirectRenderService("https://eos4.ecrion.com/");
    
    // Create a new request
    RenderRequestEntity request = new RenderRequestEntity();
    
    request.InputSettings = new InputSettings();
    request.InputSettings.Template = new Template();
    request.InputSettings.Template.Workspace = "Default";
    request.InputSettings.Template.Path = "Retail/Bookstore Invoice/Invoice.epr";
    
    request.Input = new Input();
    request.Input.InputFormat = "xml";
    request.Input.Source = "<?xml version=\"1.0\" standalone=\"yes\"?><root><Invoices><Invoice><InvoiceProperties><number>02116</number><date>2016-06-10</date></InvoiceProperties><CustomerInformation><name>Earl Library Co.</name><address>1021 South Main Street, Seattle, Washington 92315</address><email>sales@earlbook.com</email><telephone>(206)321-2345</telephone></CustomerInformation><Products><Product><id>1</id><name>Rendezvous with Rama by Arthur C. Clarke</name><price>15</price><quantity>3</quantity><total>45</total><description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke's best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description></Product></Products><Comments><comments>Contact us with any questions you may have.</comments></Comments></Invoice></Invoices></root>";
    
    request.TxtOutput = new TxtOutput();
    
    // Send the request
    Stream content = renderSvc.Render(sessionToken, request);
    

    Java

    DirectRenderService renderSvc = new DirectRenderService("https://eos4.ecrion.com/");
    
    // Create a new request
    RenderRequestEntity request = new RenderRequestEntity();
    
    InputSettings inputSettings = new InputSettings();
    Template template = new Template();
    template.setWorkspace("Default");
    template.setPath("Retail/Bookstore Invoice/Invoice.epr");
    inputSettings.setTemplate(template);
    request.setInputSettings(inputSettings);
    
    Input input = new Input();
    input.setInputFormat("xml");
    input.setSource("<?xml version=\"1.0\" standalone=\"yes\"?><root><Invoices><Invoice><InvoiceProperties><number>02116</number><date>2016-06-10</date></InvoiceProperties><CustomerInformation><name>Earl Library Co.</name><address>1021 South Main Street, Seattle, Washington 92315</address><email>sales@earlbook.com</email><telephone>(206)321-2345</telephone></CustomerInformation><Products><Product><id>1</id><name>Rendezvous with Rama by Arthur C. Clarke</name><price>15</price><quantity>3</quantity><total>45</total><description>An all-time science fiction classic, Rendezvous with Rama is also one of Clarke's best novels--it won the Campbell, Hugo, Jupiter, and Nebula Awards.</description></Product></Products><Comments><comments>Contact us with any questions you may have.</comments></Comments></Invoice></Invoices></root>");
    request.setInput(input);
    
    request.setTxtOutput(new TxtOutput());
    
    // Send the request
    java.io.InputStream response = renderSvc.render(sessionToken, request);
    

    HTTP

    curl -H "Content-Type: application/json" -X POST -u "TOKEN:7a6961b5-5be4-4318-b82e-4631659efa38" -d "{ 'Input' : {  'Source' : '<?xml version=\"1.0\" standalone=\"yes\"?><root></root>' }, 'InputSettings' : {  'Template' : {   'Workspace' : 'Default',   'Path' : 'Retail/Bookstore Invoice/Invoice.epr'  } }, 'TxtOutput' : {}}" "http://localhost:50100/api/v2/render"
    

    DirectData

    Data

    Process a data model diagram and return the output data as a stream. Ecrion Develop

    POST /api/v2/data

    Parameters

    Returns

    Notes

    If the diagram format is .edx , then the output will be an XML File.

    If the diagram format is .edm, then the output will be an IMDB File.

    If the diagram format is .edd, then the output will be a Database Output file.

    Examples

    Javascript

    eosAPI.DirectData.Data({
        request: {
            InputSettings: {
                Diagram: {
                    Workspace: "Default",
                    Path: "Retail/Bookstore Invoice/Invoice.edx"
                }
            }
        }
    })
    .then(function(response) {
        var content = response.data;
    })
    

    .NET

    DirectDataService dataSvc = new DirectDataService("https://eos4.ecrion.com/");
    
    // Create a new request
    DataRequestEntity request = new DataRequestEntity();
    
    request.InputSettings = new DataInputSettings();
    request.InputSettings.Diagram = new Diagram();
    request.InputSettings.Diagram.Workspace = "Default";
    request.InputSettings.Diagram.Path = "Retail/Bookstore Invoice/Invoice.edx";
    
    // Send the request
    Stream content = dataSvc.Data(sessionToken, request);
    

    Java

    DirectDataService dataSvc = new DirectDataService("https://eos4.ecrion.com/");
    
    // Create a new request
    DataRequestEntity request = new DataRequestEntity();
    
    DataInputSettings inputSettings = new DataInputSettings ();
    Diagram diagram = new Diagram ();
    diagram.setWorkspace("Default");
    diagram.setPath("Retail/Bookstore Invoice/Invoice.edx");
    inputSettings.setTemplate(template);
    request.setInputSettings(inputSettings);
    
    // Send the request
    java.io.InputStream response = dataSvc.data(sessionToken, request);
    

    HTTP

    curl -H "Content-Type: application/json" -X POST -d "{ 'InputSettings' : {  'Diagram' : {   'Workspace' : 'Default',   'Path' : 'Retail/Bookstore Invoice/Invoice.edx'  } }" -u "TOKEN:83b02efa-9253-413e-896b-d1011e5127fc" "http://localhost:50100/api/v2/data"
    

    Status

    GetStatus

    Get information about the server: Name, Version, Build number and Status. Ecrion Develop

    GET /api/v2/status

    Returns StatusEntity[]

    Examples

    Javascript

    eosAPI.Server.GetStatus({
        url: "http://eos4.ecrion.com",
    })
    .then(function(response) {
        var content = response.data;
    })
    

    .NET

    ServerService server = new ServerService("https://eos4.ecrion.com/");
    StatusEntity statusResponse = server.getStatus();
    

    Java

    ServerService server = new ServerService("https://eos4.ecrion.com/");
    java.util.List<StatusEntity> statuses = server.getStatus(); 
    

    HTTP

    curl -X GET --header "Accept: application/json" --header "Authorization: Basic MGFlNGFmNDEtYjUzMC00MDM4LWJlODItYTBmYThiM2YxZDU1" "http://localhost:50100/api/v2/status"