Why do the URLs to the digital asset file in the REST API give a 404 error?
The ExpiryUrl always directs to the file on the Live environment. When the digital asset is not available on the Live environment, this results in a 404 error.
The ExpiryUrl always directs to the file on the Live environment, even when the Digital asset REST API endpoint is used on the Cloud environment. This is because the file itself is not synchronized to the Cloud environment and is only available on the Live environment.
However, when the digital asset is ONLY created on the Cloud environment and does not exist on the Live environment, the ExpiryURL is created with the identifier of the file from the Cloud database and referring to the file on the Live server. However, this digital asset is not available on the live server and thus will return a 404.
Or in the situation that on the Cloud environment, a digital asset has been created and in the meanwhile another digital asset has been created on the Live environment with the same identifier, the ExpiryUrl will give the file from the Live environment. This can be a different file than expected (because on Cloud it’s a different digital asset).
However, when the digital asset is ONLY created on the Cloud environment and does not exist on the Live environment, the ExpiryURL is created with the identifier of the file from the Cloud database and referring to the file on the Live server. However, this digital asset is not available on the live server and thus will return a 404.
- The solution here is to create the digital assets on the Live environment as well. After that, do a restore from Live to Cloud to have the same digital assets.
Or in the situation that on the Cloud environment, a digital asset has been created and in the meanwhile another digital asset has been created on the Live environment with the same identifier, the ExpiryUrl will give the file from the Live environment. This can be a different file than expected (because on Cloud it’s a different digital asset).
- The solution here is to restore the database from the Live environment to the Cloud environment. Any newly created digital assets on Cloud will be gone. To test the functionality for specific digital assets created on the Cloud environment, the digital assets can be uploaded on Cloud again. But pay attention to that the URLs from the digital asset endpoint cannot be used since these digital asset files are not available on the Live environment.
Check out the SyncForce Digital Asset XML structure documentation. Also referred to from the REST API documentation on https://synf.co/restapi.