首页 > 解决方案 > WebAPI - Error Accessing ADAM Assets in 2sxc v9.42

问题描述

I am trying to access a content item's ADAM assets (e.g. uploaded files) via the 2sxc WebAPI, but I am getting a "400 The request is invalid" error.

I am able to successfully retrieve the content item properly using the following code:

$2sxc(mod).webApi.get('app/auto/content/Listings/' + listingid);

...but when I append the name of the field to the end of the URL as specified in the GitHub issue at https://github.com/2sic/2sxc/issues/1640 it returns an error:

$2sxc(mod).webApi.get('app/auto/content/Listings/' + listingid + '/Photos');

The field name "Photos" is correct, and I have also set read permissions on the it as mentioned in the GitHub issue.

Beyond that, I am also using a Metadata Content Type on the field, and I will also want to GET/UPDATE the metadata as well.

Hopefully this can all be done in 2SXC's WebAPI!

标签: 2sxc

解决方案


I reread the whole original issue and had missed the point that you must use the Entity GUID rather than the Entity ID to pull up the ADAM assets. This feature is so new that it probably hasn't been documented yet, but it appears to pull up the list of assets properly.


推荐阅读