Northstar Essentials (Create 14/Ruby) API Guide

This documentation describes the Application Programming Interfaces (API v2) for Northstar Essentials version R2025 (formerly Create 14/Ruby) and later.

Introducing Northstar Essentials API 2

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

The following features are matching the MHC Create solution:

Northstar Essentials provides the following APIs:

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

Notes

  • For Northstar Essentials installations, the default ports are 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 /swagger URL. For a local installation using the default ports, this would be:

    The default ports can be updated in the webServerSettings.json configuration of the Web API service in C:\ProgramData\MHC Software folder, by setting the HttpConfig Port parameter, respectively HttpsConfig Port.

    Getting Started

    Authentication

    NorthStar Essentials uses API keys in order to authenticate requests made by clients. You have to access the webServerSettings.json configuration of the Web API service in C:\ProgramData\MHC Software folder to find the API Key in order to use the Essentials API.

    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 MHC Create Samples then access XML Samples. You can find here samples that prove the basic conversion capabilities: MHC Studio Publisher templates and XSL-FO files for XML to PDF conversion, and also DAL files use for document assembly.

    Using .NET API

    Using the .NET API is very easy and accessible for all users to retrieve and store files in the repository. The .NET assembly contains the client-side object model that needs to be downloaded by following the next section.

    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

    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 the API to convert XML to PDF using a template stored on the NorthStar Essentials server. An XML string is sent to the server and a PDF is received back and downloaded locally.

    string apiUrl = "https://api.example.com";
    string apiKey = "898d6c1c-057f-4b8a-b429-c0bafa5a1ebf";
    string downloadFolder = "C:/Temp/";
    string fileName = "sample-xml2pdf.pdf";
    
    try
    {
        // Authenticate
        Configuration configuration = new Configuration() { BasePath = apiUrl };
        configuration.DefaultHeaders.Add("Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey)));
    
        AuthorizationApi authorizationApi = new AuthorizationApi(configuration);
        string sessionToken = authorizationApi.GetToken().AccessToken;
        Configuration directRenderApiConfig = new Configuration()
        {
            BasePath = apiUrl,
            DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
        };
    
        Console.WriteLine("Your token is: {0}", sessionToken);
    
        // Render XML -> PDF
        // Create a new Render API
        DirectRenderApi renderApi = new DirectRenderApi(directRenderApiConfig);
    
        var xml = "<?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>"
    
        // Create a new render request
        RenderRequestEntity request = new RenderRequestEntity()
        {
            InputSettings = new InputSettings()
            {
                Template = new Template()
                {
                    Workspace = "Default",
                    Path = @"Bookstore Invoice\Invoice.epr"
                }
            },
            Input = new Input()
            {
                InputFormat = "xml",
                Source = $"data:application/xml;base64,{Convert.ToBase64String(Encoding.UTF8.GetBytes(xml))}"            
            },
            PdfOutput = new PdfOutput()
        };
    
        // Send the request
        Stream response = renderApi.Render(request);
    
        Console.WriteLine("XML -> PDF rendered ok");
    
        // Download the PDF locally
        if (!Directory.Exists(downloadFolder))
            Directory.CreateDirectory(downloadFolder);
    
        // Write the file
        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 Java API

    The Java API will need the same client-side object model mentioned above written in Java.

    Downloading the API

    For core-only installations, use the SDK download page, which is by default located at https://api.example.com/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

    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 the API to convert XML to PDF using a template stored on the NorthStar Essentials server. An XML string is sent to the NorthStar Essentials server and a PDF is received back:

    String apiUrl = "https://api.example.com";
    String apiKey = "898d6c1c-057f-4b8a-b429-c0bafa5a1ebf";
    String downloadFolder = "C:/Temp/";
    String fileName = "sample-xml2pdf.pdf";
    
    // Authenticate
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(apiKey.getBytes()));
    
    AuthorizationApi authorizationApi = new AuthorizationApi(client);
    String sessionToken = authorizationApi.getToken().getAccessToken();
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    System.out.format("Your token is: %s%n", sessionToken);
    
    // Create RenderRequest
    RenderRequestEntity renderRequest = new RenderRequestEntity();
    
    InputSettings inputSettings = new InputSettings();
    Template template = new Template();
    template.setWorkspace("Default");
    template.setPath("Bookstore Invoice\\Invoice.epr");
    inputSettings.setTemplate(template);
    renderRequest.setInputSettings(inputSettings);
    
    String xml = "<?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>";
    
    Input input = new Input();
    input.setInputFormat("xml");
    input.setSource("data:application/xml;base64," + Base64.getEncoder().encodeToString(xml.getBytes()));
    renderRequest.setInput(input);
    
    renderRequest.setPdfOutput(new PdfOutput());
    
    DirectRenderApi renderApi = new DirectRenderApi(client);
    
    // Send the Request
    File response = renderApi.render(renderRequest);
    
    // Write the file
    byte[] data = Files.readAllBytes(response.toPath());
    OutputStream out = new FileOutputStream(new File(downloadFolder + fileName));
    out.write(data);
    out.close();
    
    System.out.format("File %s downloaded ok%n", downloadFolder + fileName);
    

    Note

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

    General Notes

    This section will cover the common errors encountered when using the REST APIs, along with some information about each of them and the accepted time standards.

    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

    This section helps you pay attention when work with date and time and what these parameters do by the time they leave your API platform. NorthStar Essentials solution is to use ISO standards for the time representation.

    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 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 WebAPI base URI, e.g. api/v2/token refers to https://api.example.com/api/v2/token.

    Authorization

    In order to make calls to our REST methods, you will need to provide a token. This call uses a basic authentication with configured API Key for generating a session token.

    GetToken

    Generates the access token used for all API calls.

    GET /api/v2/token

    To generate an access token, call this method and supply the configured 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 <SessionTokenBase64> format in order to authorize a generic endpoint. If you're using our .NET or Java client SDK API this process is simplified (examples below).

    Parameters

    Returns TokenEntity

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string apiKey = "0ae4af41-b530-4038-be82-a0fa8b3f1d55";
    
    // Authenticate
    Configuration configuration = new Configuration() { BasePath = apiUrl };
    configuration.DefaultHeaders.Add("Authorization", $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(apiKey))}");
    
    AuthorizationApi authorizationApi = new AuthorizationApi(configuration);
    string sessionToken = authorizationApi.GetToken().AccessToken;
    

    Java

    string apiUrl = "https://api.example.com";
    string apiKey = "0ae4af41-b530-4038-be82-a0fa8b3f1d55";
    
    ApiClient apiClient = new ApiClient();
    apiClient.setBasePath(apiUrl);
    apiClient.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(apiKey.getBytes()));
    
    AuthorizationApi authorizationApi = new AuthorizationApi(apiClient);
    String sessionToken = authorizationApi.getToken().getAccessToken();
    

    HTTP

    
    curl -X GET --header "Accept: application/json" --header "Authorization: Basic QXBpS2V5OjBhZTRhZjQxLWI1MzAtNDAzOC1iZTgyLWEwZmE4YjNmMWQ1NQ==" "https://api.example.com/api/v2/token"
    

    Direct Data

    The Direct Data API call uses diagrams as inputs, built in Modeler.

    Data

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

    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 .edo, then the output will be a Data Operations Output file.

    If the diagram format is .ede, then the output will be an Excel Output file.

    Examples

    .NET

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
     Configuration directDataApiConfig = new Configuration()
     {
         BasePath = apiUrl,
         DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
     };
    
     // Create a new Data API
     DirectDataApi dataApi = new DirectDataApi(directDataApiConfig);
    
     DataRequestEntity request = new DataRequestEntity()
     {
         InputSettings = new DataInputSettings()
         {
             Diagram = new Diagram()
             {
                 Workspace = "Sample",
                 Path = "SimpleJob.edx"
             }
         }
     };
    
     // Send the request
    using(Stream response = dataApi.Data(request))
    {
        //processing
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Data API
    DirectDataApi dataApi = new DirectDataApi(client);
    
    // Create a new request
    DataRequestEntity request = new DataRequestEntity();
    
    DataInputSettings inputSettings = new DataInputSettings ();
    Diagram diagram = new Diagram ();
    diagram.setWorkspace("Sample");
    diagram.setPath("SimpleJob.edx");
    inputSettings.setDiagram(diagram);
    request.setInputSettings(inputSettings);
    
    // Send the request
    File response = dataApi.data(request);
    

    HTTP

    curl -H "Content-Type: application/json" -X POST -d "{ 'InputSettings' : {  'Diagram' : {   'Workspace' : 'Simple',   'Path' : 'SimpleJob.edx'  } }" -H "Authorization: Basic NGI4YTg1MTgtZjU0NC00N2NhLWFmMmMtMzBmYzBlODU1NzU3" "https://api.example.com/api/v2/data"
    

    Direct Render

    The Direct Render API call allows you to configure what type of output you would like to produce, what template to use and other variables that will drive this to production. In this section, you will have access to the different configuration options for each output type.

    Render

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

    POST /api/v2/render

    Render Parameters


    Returns


    Input

    Input Settings

    Input Template

    HTML Input

    PDF Output

    HTML Output

    TXT Output

    Page Count

    Returns the page count of the result of a render task.

    POST /api/v2/pagecount

    Parameters

    Examples

    .NET

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    Configuration directRenderApiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { 
            { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } 
        }
    };
    
    // Create a new Render API
    DirectRenderApi renderApi = new DirectRenderApi(directRenderApiConfig);
    
    var xml = "<?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>";
    
    // Create a new request
    RenderRequestEntity request = new RenderRequestEntity()
    {
        InputSettings = new InputSettings()
        {
            Template = new Template()
            {
                Workspace = "Default",
                Path = @"Bookstore Invoice\Invoice.epr"
            }
        },
        Input = new Input()
        {
            InputFormat = "xml",
            Source = $"data:application/xml;base64,{Convert.ToBase64String(Encoding.UTF8.GetBytes(xml))}"
        },
        PdfOutput = new PdfOutput()
    };
    
    // Send the request
    using(Stream response = renderApi.Render(request))
    {
        //processing
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Render API
    DirectRenderApi renderApi = new DirectRenderApi(client);
    
    // Create a new request
    RenderRequestEntity request = new RenderRequestEntity();
    
    InputSettings inputSettings = new InputSettings();
    Template template = new Template();
    template.setWorkspace("Default");
    template.setPath("Bookstore Invoice/Invoice.epr");
    inputSettings.setTemplate(template);
    request.setInputSettings(inputSettings);
    
    String xml = "<?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>";
    
    Input input = new Input();
    input.setInputFormat("xml");
    input.setSource("data:application/xml;base64," + Base64.getEncoder().encodeToString(xml.getBytes()));
    request.setInput(input);
    
    request.setPdfOutput(new PdfOutput()); 
    
    // Send the request
    File response = renderApi.render(request);
    

    HTTP

    curl -H "Content-Type: application/json" -X POST -H "Authorization: Basic VE9LRU46NGI4YTg1MTgtZjU0NC00N2NhLWFmMmMtMzBmYzBlODU1NzU3" -d "{ 'Input' : {  'Source' : 'data:application/xml;base64,PD94bWwgdmVyc2lvbj1cIjEuMFwiIHN0YW5kYWxvbmU9XCJ5ZXNcIj8+PHJvb3Q+PC9yb290Pg==' }, 'InputSettings' : {  'Template' : {   'Workspace' : 'Default',   'Path' : 'Bookstore Invoice/Invoice.epr'  } }, 'TxtOutput' : {}}" "https://api.example.com/api/v2/render"
    

    Repository

    NorthStar Essentials repository stores all assets involved in document production (images, templates, stylesheets, diagrams etc.) in a file repository. The installation provides a basic level of functionality.

    Publishing Repository Methods:

    Entities:

    GetFiles

    Returns a list of files from the Publishing repository.

    GET /api/v2/files

    Parameters

    Notes

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

    2. To search files after a tag you need to specify both tagName and tagValue.

    Returns FileEntity[] - A list of FileEntity

    Examples

    .NET

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    Configuration repositoryApiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(apiConfig);
    
    // Send the request 
    List<FileEntity> files = filesApi.GetFiles("Default", "Bookstore Invoice");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(client);
    
    // Send the request 
    List<FileEntity> files = filesApi.getFiles("Default", "Bookstore Invoice", 0, 10);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/files?workspace=Default&path=Bookstore%20Invoice"
    

    __

    UpdateFile

    Rename, copy or move a file in the Publishing repository.

    PUT /api/v2/files

    Parameters

    Returns

    Examples

    .NET

    //duplicate Invoice.epr as Invoice2.epr
    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(apiConfig);
    
    // Send the request
    filesApi.UpdateFile("Default", "Bookstore Invoice/Invoice.epr",
    new FileOperationEntity()
    {
        Path = "Bookstore Invoice/Invoice2.epr",
        Action = "copy",
        Overwrite = true
    });
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(client);
    
    FileOperationEntity op = new FileOperationEntity();
    op.setPath("Bookstore Invoice/Invoice2.epr");
    op.setAction("copy");
    op.setOverwrite(true);
    
    // Send the request
    filesApi.updateFile("Default", "Bookstore Invoice/Invoice.epr", op);
    

    HTTP

    curl -H "Content-Type: application/json" -X PUT -d "{ 'Path':'Bookstore Invoice/Invoice2.epr', Action:'copy' }" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/files?workspace=Default&path=Bookstore%20Invoice/Invoice.epr"
    

    __

    DeleteFile

    Delete a file from the Publishing repository.

    DELETE /api/v2/files

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(apiConfig);
    
    // Send the request
    filesApi.DeleteFile("Default", "Bookstore Invoice/Invoice.epr");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Files API
    FilesApi filesApi = new FilesApi(client);
    
    // Send the request
    filesApi.deleteFile("Default", "Bookstore Invoice/Invoice.epr");
    

    HTTP

    curl -X DELETE  -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/files?workspace=Default&path=Bookstore%20Invoice/Invoice.epr"
    

    __

    DownloadFile

    Download a file from the Publishing repository.

    GET /api/v2/files/content

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new File Content API
    FileContentApi fileContentApi = new FileContentApi(apiConfig);
    
    // Send the request
    Stream response = fileContentApi.DownloadFile("Default", "Bookstore Invoice/Invoice.epr");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new File Content API
    FileContentApi fileContentApi = new FileContentApi(client);
    
    // Send the request
    File response = fileContentApi.downloadFile("Default", "Bookstore Invoice/Invoice.epr");
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/files/content?workspace=Default&path=Bookstore%20Invoice/Invoice.epr"
    

    __

    UploadFile

    Upload a file to the Publishing repository.

    POST /api/v2/files/content

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new File Content API
    FileContentApi fileContentApi = new FileContentApi(apiConfig);
    
    using (Stream stm = File.OpenRead(@"C:\Temp\Sample.xml", FileMode.Open, FileAccess.Read))
    {
        // Send the request
        FileEntity newFile = fileContentApi.UploadFile("Default", "Bookstore Invoice/Sample.xml", stm);
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new File Content API
    FileContentApi fileContentApi = new FileContentApi(client);
    
    java.io.File uploadFile = new java.io.File("C:\\Sample.xml");   
    
    // Send the request
    FileEntity newFile = fileContentApi.uploadFile(token, "Default", "Bookstore Invoice/Sample.xml", uploadFile);
    

    HTTP

    curl -X POST -F "file=@C:\Sample.xml" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/files/content?workspace=Default&path=Bookstore%20Invoice/Sample.xml"
    

    __

    CreateFolder

    Create a new folder in the Publishing repository.

    POST /api/v2/folders

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(apiConfig);
    
    // Send the request
    foldersApi.CreateFolder("Default", "NewFolder");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(client);
    
    // Send the request
    foldersApi.createFolder("Default", "NewFolder");
    

    HTTP

    curl -X POST -d "{'path' : 'NewFolder'}" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/folders?workspace=Default&path=NewFolder"
    

    __

    GetFolders

    Returns a list of folders in the specified parent path and workspace from the Publishing repository.

    GET /api/v2/folders

    Parameters

    Returns FolderEntity[] - A list of FolderEntity

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(client);
    
    // Send the request
    List<FolderEntity> folders = foldersApi.GetFolders("Default", "Bookstore Invoice");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(client);
    
    // Send the request
    List<FolderEntity> folders =  foldersApi.getFolders("Default", "Bookstore Invoice", 0, 10);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/folders?workspace=Default&path=Bookstore%20Invoice"
    

    __

    DeleteFolder

    Delete an existing folder from the Publishing repository.

    DELETE /api/v2/folders

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(client);
    
    // Send the request
    foldersApi.DeleteFolder("Default", "Bookstore Invoice");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Folders API
    FoldersApi foldersApi = new FoldersApi(client);
    
    // Send the request
    foldersApi.deleteFolder("Default", "Bookstore Invoice");
    

    HTTP

    curl -X DELETE -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/folders?workspace=Default&path=Bookstore%20Invoice"
    

    ExportFolder

    Download a zip file of a folder from the Publishing repository.

    GET /api/v2/folders/content

    Parameters

    Returns

    Examples

    .NET

    // Export Bookstore Invoice folder
    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Folders Content API
    FoldersContentApi foldersContentApi = new FoldersContentApi(apiConfig);
    
    // Send the request
    Stream zip = foldersContentApi.ExportFolder("Default", "Bookstore Invoice");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Folders Content API
    FoldersContentApi foldersContentApi = new FoldersContentApi(client);
    
    // Send the request
    File zip  = foldersContentApi.exportFolder("Default", "Retail/Bookstore Invoice");
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/folders/content?workspace=Default&path=Bookstore%20Invoice"
    

    __

    ImportFolder

    Decompress an archive and uploads its content to the Publishing repository.

    POST /api/v2/folders/content

    Parameters

    Returns

    Examples

    .NET

    // Import 'myFolder' to Bookstore Invoice folder
    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Folders Content API
    FoldersContentApi foldersContentApi = new FoldersContentApi(client);
    
    using (Stream zip = File.OpenRead(@"C:\Sample.zip"))
    {
         // Send the request
        FolderEntity folder = foldersContentApi.ImportFolder("Default", "Bookstore Invoice/", zip);
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Folders Content API
    FoldersContentApi foldersContentApi = new FoldersContentApi(client);
    
    File fileSource = new File("C:\\Sample.zip");
    
     // Send the request
    foldersContentApi.importFolder("Default", "Bookstore Invoice", fileSource);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" -F filedata=@"C:\myFolder.zip" "https://api.example.com/api/v2/folders/content?workspace=Default&path=Bookstore%20Invoice"
    

    Data Repository Methods:

    Entities:

    DiagramGetFiles

    Returns a list of files from the Data repository.

    GET /api/v2/diagram/files

    Parameters

    Notes

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

    2. To search files after a tag you need to specify both tagName and tagValue.

    Returns Data FileEntity[] - A list of FileEntity

    Examples

    .NET

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    Configuration repositoryApiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(apiConfig);
    
    // Send the request 
    List<FileEntity> files = filesApi.DiagramGetFiles("Sample", "/");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(client);
    
    // Send the request 
    List<FileEntity> files = filesApi.diagramGetFiles("Sample", "/", 0, 10);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/files?workspace=Sample&path=/"
    

    __

    DiagramUpdateFile

    Rename, copy or move a file in the Data repository.

    PUT /api/v2/diagram/files

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(apiConfig);
    
    // Send the request
    filesApi.DiagramUpdateFile("Sample", "SimpleJob.edx",
    new FileOperationEntity()
    {
        Path = "SimpleJob2.edx",
        Action = "copy",
        Overwrite = true
    });
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(client);
    
    FileOperationEntity op = new FileOperationEntity();
    op.setPath("SimpleJob2.edx");
    op.setAction("copy");
    op.setOverwrite(true);
    
    // Send the request
    filesApi.digramUpdateFile("Sample", "SimpleJob.edx", op);
    

    HTTP

    curl -H "Content-Type: application/json" -X PUT -d "{ 'Path':'SimpleJob2.edx', Action:'copy' }" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/files?workspace=Sample&path=SimpleJob.edx"
    

    __

    DiagramDeleteFile

    Delete a file from the Data repository.

    DELETE /api/v2/diagram/files

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(apiConfig);
    
    // Send the request
    filesApi.DiagramDeleteFile("Sample", "SimpleJob.edx");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Files API
    DiagramFilesApi filesApi = new DiagramFilesApi(client);
    
    // Send the request
    filesApi.diagramDeleteFile("Sample", "SimpleJob.edx");
    

    HTTP

    curl -X DELETE  -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/files?workspace=Sample&path=SimpleJob.edx"
    

    __

    DiagramDownloadFile

    Download a file from the Data repository.

    GET /api/v2/diagram/files/content

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram File Content API
    DiagramFileContentApi fileContentApi = new DiagramFileContentApi(apiConfig);
    
    // Send the request
    Stream response = fileContentApi.DiagramDownloadFile("Sample", "SimpleJob.edx");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram File Content API
    DiagramFileContentApi fileContentApi = new DiagramFileContentApi(client);
    
    // Send the request
    File response = fileContentApi.diagramDownloadFile("Sample", "SimpleJob.edx");
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/files/content?workspace=Sample&path=SimpleJob.edx"
    

    __

    DiagramUploadFile

    Upload a file to the Data repository.

    POST /api/v2/diagram/files/content

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram File Content API
    DigramFileContentApi fileContentApi = new DiagramFileContentApi(apiConfig);
    
    using (Stream stm = File.OpenRead(@"C:\Temp\Sample.xml", FileMode.Open, FileAccess.Read))
    {
        // Send the request
        FileEntity newFile = fileContentApi.DiagramUploadFile("Sample", "Sample.xml", stm);
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram File Content API
    DiagramFileContentApi fileContentApi = new DiagramFileContentApi(client);
    
    java.io.File uploadFile = new java.io.File("C:\\Sample.xml");   
    
    // Send the request
    FileEntity newFile = fileContentApi.diagramUploadFile(token, "Default", "Sample.xml", uploadFile);
    

    HTTP

    curl -X POST -F "file=@C:\Sample.xml" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/files/content?workspace=Sample&path=Sample.xml"
    

    __

    DiagramCreateFolder

    Create a new folder in the Data repository.

    POST /api/v2/diagram/folders

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(apiConfig);
    
    // Send the request
    foldersApi.DiagramCreateFolder("Sample", "NewFolder");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(client);
    
    // Send the request
    foldersApi.diagramCreateFolder("Sample", "NewFolder");
    

    HTTP

    curl -X POST -d "{'path' : 'NewFolder'}" -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/folders?workspace=Sample&path=NewFolder"
    

    __

    DiagramGetFolders

    Returns a list of folders in the specified parent path and workspace from the Data repository.

    GET /api/v2/diagram/folders

    Parameters

    Returns Data FolderEntity[] - A list of FolderEntity

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(client);
    
    // Send the request
    List<FolderEntity> folders = foldersApi.DiagramGetFolders("Sample", "/");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(client);
    
    // Send the request
    List<FolderEntity> folders =  foldersApi.diagramGetFolders("Sample", "/", 0, 10);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/folders?workspace=Sample&path=/"
    

    __

    DiagramDeleteFolder

    Delete an existing folder from the Data repository.

    DELETE /api/v2/diagram/folders

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(client);
    
    // Send the request
    foldersApi.DiagramDeleteFolder("Sample", "Folder");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Folders API
    DiagramFoldersApi foldersApi = new DiagramFoldersApi(client);
    
    // Send the request
    foldersApi.diagramDeleteFolder("Sample", "Folder");
    

    HTTP

    curl -X DELETE -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/folders?workspace=Sample&path=Folder"
    

    DiagramExportFolder

    Download a zip file of a folder from the Data repository.

    GET /api/v2/diagram/folders/content

    Parameters

    Returns

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Folders Content API
    DiagramFoldersContentApi foldersContentApi = new DiagramFoldersContentApi(apiConfig);
    
    // Send the request
    Stream zip = foldersContentApi.DiagramExportFolder("Sample", "/");
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Folders Content API
    DiagramFoldersContentApi foldersContentApi = new DiagramFoldersContentApi(client);
    
    // Send the request
    File zip  = foldersContentApi.diagramExportFolder("Sample", "/");
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" "https://api.example.com/api/v2/diagram/folders/content?workspace=Sample&path=/"
    

    __

    DiagramImportFolder

    Decompress an archive and uploads its content to the Data repository.

    POST /api/v2/diagram/folders/content

    Parameters

    Returns

    Examples

    .NET

    // Import 'myFolder' to Bookstore Invoice folder
    string apiUrl = "https://api.example.com";
    string sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    Configuration apiConfig = new Configuration()
    {
        BasePath = apiUrl,
        DefaultHeaders = new Dictionary<string, string>() { { "Authorization", "Basic " + Convert.ToBase64String(Encoding.UTF8.GetBytes(sessionToken)) } }
    };
    
    // Create a new Diagram Folders Content API
    DiagramFoldersContentApi foldersContentApi = new DiagramFoldersContentApi(client);
    
    using (Stream zip = File.OpenRead(@"C:\Sample.zip"))
    {
         // Send the request
        FolderEntity folder = foldersContentApi.DiagramImportFolder("Sample", "/", zip);
    }
    

    Java

    String apiUrl = "https://api.example.com";
    String sessionToken = "c87ca566-2587-4480-8a7a-27531f04af80";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    client.addDefaultHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(sessionToken.getBytes()));
    
    // Create a new Diagram Folders Content API
    DiagramFoldersContentApi foldersContentApi = new DiagramFoldersContentApi(client);
    
    File fileSource = new File("C:\\Sample.zip");
    
     // Send the request
    foldersContentApi.diagramImportFolder("Sample", "/", fileSource);
    

    HTTP

    curl -H "Authorization: Basic Yzg3Y2E1NjYtMjU4Ny00NDgwLThhN2EtMjc1MzFmMDRhZjgw" -F filedata=@"C:\myFolder.zip" "https://api.example.com/api/v2/diagram/folders/content?workspace=Sample&path=/"
    

    Status

    The Status API call uses the status of a HTTP response message to inform users about the server.

    GetStatus

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

    GET /api/v2/status

    Returns StatusEntity

    Examples

    .NET

    string apiUrl = "https://api.example.com";
    
    // Create a new Status API
    StatusApi statusApi = new StatusApi(apiUrl);
    
    // Send the request
    StatusEntity status = statusApi.Status();
    

    Java

    String apiUrl = "https://api.example.com";
    
    ApiClient client = new ApiClient();
    client.setBasePath(apiUrl);
    
    // Create a new Status API
    StatusApi statusApi = new StatusApi(client);
    
    // Send the request
    StatusEntity status = statusApi.status();   
    

    HTTP

    curl -X GET "https://api.example.com/api/v2/status"