// get image
String ApiIDquery = "user=" + APIuser + "&function=get_resource_path¶m1=" + refID + "¶m2=¶m3=pre¶m4=¶m5=jpg"; - pass image Id, null, pre(meaning image preview size, null and jpg exention
String idHash = privateKey + ApiIDquery; concatenate with private key
String apiIDCode = getHashSha256(idHash); -- subroutine that hashes the above string
String idLowerCode = apiIDCode.ToLower(); -- for some reason with .net we have to make the result lower case - not sure why.
var idUrl = "http://[url to site]/resourcespace/api/?" + ApiIDquery + "&sign=" + idLowerCode; - make the whole thing into a URL -- this returns json code containing the string to the preview that then needs to be in your img tag. This all looks a bit scary but .net does - it is way easier in php.
If I get some time and people are interested I'll make the code more generic and post it.