I'm writing a program that creates a new asset in Content Hub using the upload API. How do I attach that newly created asset to theImageField of an item in Sitecore. Most of the examples show how to create a new ImageField item using something from the media library but I haven't found anything using Content Hub. Here's the basics of what I've got so far which obviously doesn't work but it illustrates what I'm trying to accomplish:
using (new SecurityDisabler())
{
var providerItem= db.GetItem(this.SiteCorePath);
if (providerItem.Empty) return false;
this.providerItem.Fields.ReadAll();
this.providerItem.Editing.BeginEdit();
try
{
this.providerItem.Fields["SelectHealth Image"].Value = this.PublicUrl;
this.providerItem.Editing.EndEdit();
}
catch
{
this.providerItem.Editing.CancelEdit();
return false;
}
}