Content Hub: Get public link for asset from Web SDK Client

Today our topic is getting the public link(s) for an asset in the Content Hub via Web SDK Client. Therefore we first need the configuration and client. Keep in mind, that the user you use must be a superuser.

// Your Sitecore Content Hub endpoint to connect to
Uri endpoint = new Uri("https://yourcontenthuburl");

// Enter your credentials here         
OAuthPasswordGrant oauth = new OAuthPasswordGrant         
{             
  ClientId = "yourclientid",             
  ClientSecret = "yourclientsecret",             
  UserName = "yoursuperusername",             
  Password = "youruserpassword"         };         

// Create the Web SDK client         
IWebMClient client = MClientFactory.CreateMClient(endpoint, oauth);         client.TestConnectionAsync().Wait();

Continue reading “Content Hub: Get public link for asset from Web SDK Client”