Skip to main content

GetDownloadUrl

The DownloadUrl information of an object in Document Management can be accessed using the following codes.

Required Libraries

using System;
using System.Collections.Generic;
using Bimser.CSP.FormControls.Common;
using Bimser.CSP.FormControls.Controls;
using Bimser.CSP.FormControls.Events;
using Bimser.Synergy.Entities.Shared.Business.Objects;
using Bimser.Synergy.ServiceAPI;
using Bimser.Synergy.ServiceAPI.Models.Authentication;
using Bimser.Synergy.ServiceAPI.Models.Form;
using Newtonsoft.Json;
using Bimser.Synergy.Entities.DocumentManagement.Business.DTOs.Requests;
using Bimser.Synergy.Entities.DocumentManagement.Business.DTOs.Responses;
using Bimser.Framework.Web.Models;
using System.Linq;

Codes

string path = "DM Object Path Information";

WrapResponse```<```GetDMObjectsResponse```>``` dmObject = ServiceApi.DocumentManagement.GetDMObjectsFromPath(
new GetDMObjectsFromPathRequest(path)). Result;
GetDMObjectResponse dMObjectResponse = dmObject.Result.Items.First();

string downloadUrl = ServiceApi.DocumentManagement.GetDownloadUrl(
dMObjectResponse.SecretKey,
dMObjectResponse.Name["en-EN"]
). Result.DownloadUrl;

downloadUrl = WebInterfaceUrl + downloadUrl;