I managed to find the answer to my own question after some trial and error, and I'm posting here the information in case someone else bumps into the same problem.
This is the build icon URL that comes inside the response of v1/builds/{id}/icons request to AppStoreConnect API:
https://is4-ssl.mzstatic.com/image/thumb/Purple126/v4/96/d8/9e/96d89ef8-13cb-8b09-8647-301d410b1807/AppIcon-0-1x_U007emarketing-0-5-0-85-220.png/{w}x{h}.{f}
Don't make a GET request to this URL as-is because it won't work. You will get a 404 not found HTTP error.
Make theses changes to the URL:
- replace {w} with the value (INT) that comes in attributes->width
- replace {h} with the value (INT) that comes in attributes->height
- replace {f} with ".png" as most (if not all) icons are PNG files
Applying this 3 changes to the above URL, we get:
https://is4-ssl.mzstatic.com/image/thumb/Purple126/v4/96/d8/9e/96d89ef8-13cb-8b09-8647-301d410b1807/AppIcon-0-1x_U007emarketing-0-5-0-85-220.png/1024x1024bb.png
Copy and paste this URL to your browser and voilà! You've got the build icon ;-)
The need for this replacements is not documented on AppStoreConnect API online documentation.