Skip to content

Commit 2462c2e

Browse files
authored
Merge pull request #636 from akeneo/API-1803-1804-filter-records-and-assets-by-code
API-1803 & API-1804: Filter Asset & Reference Entity by codes
2 parents 1037a78 + 9d63743 commit 2462c2e

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

content/files/Akeneo PIM API.postman_collection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,6 +2159,11 @@
21592159
"records"
21602160
],
21612161
"query": [
2162+
{
2163+
"key": "search",
2164+
"value": "{\"code\":[{\"operator\":\"IN\",\"value\":[\"bangolufsen\",\"kartell\"]}]}",
2165+
"disabled": true
2166+
},
21622167
{
21632168
"key": "search",
21642169
"value": "{\"complete\":{\"operator\":\"=\",\"value\":true,\"channel\":\"ecommerce\",\"locales\":[\"en_US\"]}}",
@@ -2833,6 +2838,11 @@
28332838
"assets"
28342839
],
28352840
"query": [
2841+
{
2842+
"key": "search",
2843+
"value": "{\"code\":[{\"operator\":\"IN\",\"value\":[\"absorb_atmosphere_1\",\"absorb_atmosphere_2\"]}]}",
2844+
"disabled": true
2845+
},
28362846
{
28372847
"key": "search",
28382848
"value": "{\"updated\":[{\"operator\":\">\",\"value\":\"2022-05-01T10:00:00Z\"}]}",

content/rest-api/filter.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,9 +1241,24 @@ When requesting locales, you can use a filter to get the enabled ones.
12411241

12421242
## Filter reference entity records
12431243

1244-
::: info
1245-
All these filters are available starting the 3.0 version of the PIM.
1246-
:::
1244+
### By record codes
1245+
1246+
::: availability versions=SaaS editions=EE
1247+
1248+
You can filter the reference entity records by their code.
1249+
1250+
Below is the operator to filter on this property, as well as the corresponding type of value expected in the `search` query parameter.
1251+
1252+
| Operator | Allowed value type | Filter description |
1253+
|----------|------------------------------------|-------------------------------------------|
1254+
| `IN` | an array of existing record codes | Only returns records that are in the list |
1255+
1256+
#### Example
1257+
1258+
```
1259+
/api/rest/v1/reference-entities/brands/records?search={"code":[{"operator":"IN","value":["code1","code2"]}]}
1260+
```
1261+
12471262

12481263
### By completeness
12491264

@@ -1460,6 +1475,24 @@ As a result you will receive the following answer:
14601475

14611476
When requesting a [list of assets via the REST API](/api-reference.html#get_assets), you can apply filters to get only the ones you want and also the kind of information you want in them.
14621477

1478+
### By asset codes
1479+
1480+
::: availability versions=SaaS editions=EE
1481+
1482+
You can filter the assets by their code.
1483+
1484+
Below is the operator to filter on this property, as well as the corresponding type of value expected in the `search` query parameter.
1485+
1486+
| Operator | Allowed value type | Filter description |
1487+
|----------|----------------------------------|------------------------------------------|
1488+
| `IN` | an array of existing asset codes | Only returns assets that are in the list |
1489+
1490+
#### Example
1491+
1492+
```
1493+
/api/rest/v1/asset-families/model_pictures/assets?search={"code":[{"operator":"IN","value":["code1","code2"]}]}
1494+
```
1495+
14631496
### By update date
14641497

14651498
You can filter the assets by their update date.

0 commit comments

Comments
 (0)