将多个资产上传到一个实体
Upload Multiple Assets to an Entity
文档上说 Only 1 asset can be attached to an entity.
有没有办法将多个图像附加到一个实体?
目前这是不可能的。您可以通过使用 folders 并将它们连接到用户或其他实体来解决此限制:
Linking a folder to an asset
In order to access the asset for the image in the folder, you need to link the folder to the asset. You can do that by issuing a POST request in the following format:
POST /{org-uuid}/{app-uuid}/folders/{folder-uuid}/assets/{assets_id}
where {folder-uuid}
is the UUID of the folder, and {assets-uuid}
is the UUID of the assets entity.
Here’s how you could link the folder and the asset you created for the my-image.jpg image:
POST https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b
文档上说 Only 1 asset can be attached to an entity.
有没有办法将多个图像附加到一个实体?
目前这是不可能的。您可以通过使用 folders 并将它们连接到用户或其他实体来解决此限制:
Linking a folder to an asset
In order to access the asset for the image in the folder, you need to link the folder to the asset. You can do that by issuing a POST request in the following format:
POST /{org-uuid}/{app-uuid}/folders/{folder-uuid}/assets/{assets_id}
where
{folder-uuid}
is the UUID of the folder, and{assets-uuid}
is the UUID of the assets entity.Here’s how you could link the folder and the asset you created for the my-image.jpg image:
POST https://api.usergrid.com/my-org/my-app/folders/6640a601-2ac6-11e2-92c3-02e81ae640dc/assets/9501cda1-2d21-11e2-b4c6-02e81ac5a17b