How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#5836 by Anshul Dua
15 Mar 2018, 10:08
Hi Team, Here i wan to filter the product according to the attributes using JSON API. Can i list the attribute using attribute type? in
#5838 by aimeos
15 Mar 2018, 21:08
Yes, sure. Use a filter for "attribute.type.code":
Code: Select allvar params = {];

if( servicedesc.meta.prefix ) {
    params[servicedesc.meta.prefix] = {filter: {'==': {'attribute.type.code': 'mytype'}}};
} else {
    params = {filter: {'==': {'attribute.type.code': 'mytype'}}};
}
 
$.ajax({
    method: "GET",
    dataType: "json",
    url: servicedesc.meta.resources['attribute'], // returned from OPTIONS call
    data: params
}).done( function( result ) {
    console.log( result.data );
});


It's documented there:
Filtering: https://aimeos.org/docs/Developers/Client/JSONAPI/Fetch_items#Filtering_the_result
Parameter nesting: https://aimeos.org/docs/Developers/Client/JSONAPI/Retrieve_metadata#Nested_parameters
#5842 by aimeos
16 Mar 2018, 09:01
In your client application that calls the JSON REST API server endpoints
#5847 by Anshul Dua
16 Mar 2018, 17:07
My issues are resolved. One more thing
Can i get the attribute list according to the attribute type. Because this will easier to filter the data and compare the attribute lable with my value.?
Currently I am using this API to list the attributes
http://localhost/jsonapi/attribute