Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Add ability to request metadata for multiple assets in one call #14

Open
jhedstrom opened this issue Sep 23, 2020 · 0 comments · May be fixed by #15
Open

Add ability to request metadata for multiple assets in one call #14

jhedstrom opened this issue Sep 23, 2020 · 0 comments · May be fixed by #15

Comments

@jhedstrom
Copy link

The DAM API supports passing in multiple asset IDs to the metadata endpoint. (example https://apiv2.webdamdb.com/assets/2342322,5342344/metadatas/xmp)

The current code assumes only a single asset ID though:

    $response = json_decode((string) $response->getBody());

    $metadata = [];
    foreach ($response->active_fields as $field) {

resulting in errors if multiple IDs are passed (such as '123,45,67') as the response format is different if more than a single asset ID is passed.

The change here could either be a completely new method that takes an array of IDs and internally concatenates them with a comma, or refactor the current method to work with both single IDs or comma-concatenated list of IDs.

jhedstrom added a commit to jhedstrom/php-webdam-client that referenced this issue Sep 23, 2020
@jhedstrom jhedstrom linked a pull request Sep 23, 2020 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant