Jsonapi Typo3 Endpoint/ Search Products
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Jsonapi Typo3 Endpoint/ Search Products
Hello,
we use an Aimeos store in Typo3. We would like to add a search function to the website. How is this possible?
We wanted to search for products via jsonapi, however we can not find the correct endpoint/ url path. "/jsonapi" returns 404 not found. What is the correct address for Typo 3?
Thanks a lot for the help.
(Version 18.10/ Windows)
we use an Aimeos store in Typo3. We would like to add a search function to the website. How is this possible?
We wanted to search for products via jsonapi, however we can not find the correct endpoint/ url path. "/jsonapi" returns 404 not found. What is the correct address for Typo 3?
Thanks a lot for the help.
(Version 18.10/ Windows)
Re: Jsonapi Typo3 Endpoint/ Search Products
The JSON API endpoint depends on the TYPO3 URL of the "jsonapi" page in the page tree. If it's "Shop > jsonapi", then your URL should be "/shop/jsonapi".
Please note that Aimeos 18.10 is gets bugfixes and security fixes within the ELTS package:
https://aimeos.com/support#c428
The other option is to upgrade to 21.10 LTS to be on the save side.
Please note that Aimeos 18.10 is gets bugfixes and security fixes within the ELTS package:
https://aimeos.com/support#c428
The other option is to upgrade to 21.10 LTS to be on the save side.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Jsonapi Typo3 Endpoint/ Search Products
Thank you very much for the quick reply, that helped a lot.
The URL we got back via OPTIONS works fine.
However, as soon as a filter is added, we get a "404 Page not found" error.
We have tried a few different filters, but always get a 404 error.
Url without Filter:
/shop/json-api?ai[action]=options&ai[controller]=Jsonapi&ai[resource]=product&cHash=1487183df0c22c27b95b6a6ed721e574
URl with Filter:
/shop/json-api?ai[action]=options&ai[controller]=Jsonapi&ai[resource]=product&cHash=1487183df0c22c27b95b6a6ed721e574&ai[filter][>][product.type]=select
The URL we got back via OPTIONS works fine.
However, as soon as a filter is added, we get a "404 Page not found" error.
We have tried a few different filters, but always get a 404 error.
Url without Filter:
/shop/json-api?ai[action]=options&ai[controller]=Jsonapi&ai[resource]=product&cHash=1487183df0c22c27b95b6a6ed721e574
URl with Filter:
/shop/json-api?ai[action]=options&ai[controller]=Jsonapi&ai[resource]=product&cHash=1487183df0c22c27b95b6a6ed721e574&ai[filter][>][product.type]=select
Code: Select all
var url = '/shop/json-api'; // Base URL from config
var promise = $.ajax( url, {
method: "OPTIONS",
dataType: "json"
});
promise.done( function( options ) {
var args = {
'filter': {
'>': {'product.type': 'select'}
}
};
var params = {};
if(options.meta.prefix) { // returned from OPTIONS call
params[options.meta.prefix] = args;
} else {
params = args;
}
$.ajax({
method: "GET",
dataType: "json",
url: options.meta.resources['product'], // returned from OPTIONS call
data: params
}).done( function( result ) {
console.log( result.data );
});
});
Re: Jsonapi Typo3 Endpoint/ Search Products
Maybe the cHash is the problem. Does it work if you remove it from the URL?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star