You are not logged in.
Scenario:
Search through available assets using keywords.
Return relevant assets along with a permanent link to the latest revision in both high res PDF and low res PNG.
As far as I can see, I cannot get download links to the assets that are returned from the search in one go.
I must loop through the assets, one by one sending them off to the "Downloads_GetLink" for the low res, and again for the high res.
Is it not possible to get download links for an array/hash of asset IDs all at once?
For example:
$search_return = array('123', '456', '789');
$args = array('assetId' => $search_return, 'settings' => array('format' => 'JPG', 'rev' => 'CURRENT', 'permanent' => true));
Send to Downloads_GetLink
Would result in all 3 images returning a maximum res JPG URL of the current revision.
And then sending them off again for the low res.
This would mean only 2 function calls instead of 6 as I currently have to do.
This exponentially slows down the script based on the amount of images returned from a search, which is extremely problematic.
For example, should there be 10 results, it currently has to make 20 calls to Downloads_GetLink, whereas if it accepted an array, it would still only make 2 calls.
Is there any other approach to this scenario that would be better than what I have got currently?
Thanks in advance.
Offline
Hi,
Sorry that your question hasn't got a response until now.
At present there isn't a better way to do what you're doing. However, just to make sure of a few things:
1) do you absolutely need the PNG? would a JPG be OK?
2) are you aware (I don't think this is documented unfortunately) that the search call can accept a thumbsize option so you can request a thumbsize up to 1200x800 (but JPG only)
3) can the consumer of your data perform api calls - i.e. you could postpone the GetLink(original) call until you definitely need the original.
4) out of interest how long does it take for your IMS to respond to a GetLink() call? because they should be very quick, so although you are having to send many requests they shouldn't take all that long. I appreciate it's still not ideal but just checking that there isn't something wrong with the server that we could investigate further.
And lastly, we're looking internally at implementing the "multi version" of the GetLink call. It's not going to be a lot of work so we'll probably implement it fairly shortly. Unfortunately I can't give a more precise timescale right now.
Ben
Offline
Hi Ben,
Thanks for the reply.
To answer your questions:
1. Yes, it must have transparency.
2. I think I may have been aware of this, I can't quite remember. But regardless, as above, PNG is required.
3. No, I'm afraid not.
4. It ranges between 0.15 to 0.225 seconds per call, which is already a little on the slow side. This quickly adds up, and a folder with 44 images in (thus 88 calls) takes anywhere between 12 and 20 seconds to fully process. Obviously, the more images, the worse it gets.
I'm glad you're looking at a multi version of the GetLink call as this is pretty crucial to one of our requirements of the DAM. It struck me as a potentially very easy implementation at your end, so thought it was worth bringing up.
Thanks again.
Offline
Hi Paul,
We have implemented the multi-version internally, although it is not yet released. This will accept an array of assetIds, and an equivalent settings hash (with the additional ability to override the settings per-file in sub-hashes).
Dominic
Offline
Hi Dominic,
That sounds perfect! Thanks.
Offline
Hi both,
Thanks for sorting this out. You'll be glad to know that it now means our script has gone from 0.5 seconds per image returned to 0.5 seconds no matter how many images.
Kind regards,
Paul
Offline
Great to hear!
For the benefit of anyone else looking for this, Downloads.GetMultiLink is available from IMS v6.1.8-5 onwards.
Dominic
Offline