Aspose is extending its community by providing robust and efficient file formatting APIs. We are glad to announce our another Cloud API named Aspose.Diagram Cloud. It is a platform independent REST API, that allows developers to work with Microsoft Visio files in their application without installing Microsoft Visio. It seamlessly enhances your application with the capability to create, read and convert Microsoft Visio Diagram files using a simple set of requests.

The following sections describe some feature details of Aspose.Diagram Cloud REST API. Please also check the first release notes for more details.

Aspose.Diagram Cloud Features

It supports working with native VSD/VSDX format as well as other popular Visio formats including VSS, VST, VSX, VTX, VDW, VDX, VSSX, VSTX, VSDM, VSSM and VSTM. First version of Aspose.Diagram Cloud provides following features:

Supported formats

Read: VDW, VSD, VSS, VST

Read and Write: VSDX, VSX, VTX, VDX, VSSX, VSTX, VSDM, VSSM, VSTM

Export: BMP, JPEG, TIFF, EMF, SVG, PNG, PDF, HTML, XPS, SWF, XAML

Convert diagram to another format

Aspose.Diagram Cloud REST API provides feature to convert microsoft visio diagram to other popular formats for quick and easy information sharing across the organization. Please see the following URI and REST command(cURL) for the purpose.

URI

https://api.aspose.cloud/v1.1//diagram/{filename}/SaveAs 

Aspose.Diagram Cloud for cURL example

// First get Access Token
// Get App Key and App SID from https://dashboard.aspose.cloud/
curl -v "https://api.aspose.cloud/oauth2/token" \
-X POST \
-d 'grant_type=client_credentials&[Your AppSid]&client_secret=[Your AppKey]' \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
  
// cURL example to convert Diagram file to another format
curl -v "https://api.aspose.cloud/v1.1/diagram/file_get_1.vdx/SaveAs?IsOverwrite=true&newfilename=file_get_1.pdf" \
-X POST \
-d '{"Format":"pdf"}' \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer [Access Token]" 

Aspose.Diagram Cloud SDK for.NET example

protected ApiClient client;
protected Configuration config;
protected static OAuthApi oauth2 = null;
protected string grantType = "client_credentials";
protected string clientId = ""; // Get App Key and App SID from https://dashboard.aspose.cloud/
protected string clientSecret = ""; // Get App Key and App SID from https://dashboard.aspose.cloud/
protected static string accesstoken;
protected string refreshtoken;

static void Main(string[] args)
{
    DiagramExamples diagramExamples = new DiagramExamples();
    // Convert Diagram File to Another Format
    diagramExamples.PostSaveAs();
}

// Convert Diagram File to Another Format
private void PostSaveAs()
{
    DiagramFileApi instance = new DiagramFileApi(GetConfiguration());

    string name = "file_get_1.vdx";
    bool isOverwrite = true;
    string folder = null;

    FileFormatRequest format = new FileFormatRequest() { Format = "pdf" };
    string newfilename = "file_saveas_1.pdf";

    UpdateDataFile(name);
    var response = instance.DiagramFilePostSaveAs(name, format, newfilename, folder, isOverwrite);
}

private void UpdateDataFile(string filename)
{
    StorageApi StorageApi = new StorageApi(clientSecret, clientId);

    // Upload document to Cloud Storage
    PutCreateRequest request = new PutCreateRequest(filename, File.OpenRead(@"c:\Data\" + filename), null, null);
    StorageApi.PutCreate(request);
}

private Configuration GetConfiguration()
{
    if (oauth2 == null)
    {
        oauth2 = new OAuthApi("https://api.aspose.cloud");
        var oauth2response = oauth2.OAuthPost(grantType, clientId, clientSecret);
        accesstoken = oauth2response.AccessToken;
        refreshtoken = oauth2response.RefreshToken;
    }
    Dictionary<string, string> headerParameters = new Dictionary<string, string>();
    headerParameters.Add("Authorization", "Bearer " + accesstoken);
    client = new ApiClient();
    config = new Configuration(client, headerParameters);
    return config;
} 

Security and Authentication

The Aspose.Diagram Cloud REST API is secured and requires authentication using an app access key ID (appSID) and app secret access key with OAuth 2.0 or URL Signing authorization header. You can see the complete details here.

API Explorer

Aspose for Cloud REST APIs comes with a web based API Explorer as well. It is the easiest way to try out our API right away in your browser. It is a collection of Swagger documentation for the aspose.cloud APIs. So simply, first you need to sign up with aspose.cloud, get APP key and SID and start testing Aspose.Diagram Cloud REST API in your favorite browser interactively.

SDKs

Aspose.Diagram Cloud REST API comes with SDKs for different platforms to use this REST API in your specific project effortlessly. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Please check out our GitHub repository for a complete list of Aspose.Diagram Cloud SDKs along with working examples, to get you started in no time.

Aspose.Diagram Cloud Resources

Following are the links to some useful resources you may need to accomplish your tasks.

Start a Free Trial Today

Start a free trial today – all you need is to sign up with the Aspose Cloud service. Once you have signed up, you are ready to try the powerful file processing features offered by Aspose for Cloud.

Related Post:

Convert VSDX to PDF