add new JSON API resouce
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!
- мужыковмужыков
- Posts: 10
- Joined: 08 Sep 2023, 08:52
add new JSON API resouce
Hi,
How can I add a new custom JSON API resource and use it?
How can I add a new custom JSON API resource and use it?
Re: add new JSON API resouce
If you have created a manager for a new data domain that contains only one table (and no lists or property table), then you can query the new resource directly over the JSON API. Just configure the new resource in the ./config/client.php file of your extension:
See also: https://github.com/aimeos/ai-client-jso ... client.php
Code: Select all
'jsonapi' => [
'resources => [
'mydomain' => 'mydomain'
]
]
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
- мужыковмужыков
- Posts: 10
- Joined: 08 Sep 2023, 08:52
Re: add new JSON API resouce
I've added my own resource, but it works only with GET method, for other method I receive 419 Error (Page Expired). How I can fix that? I tried post method into class, but it still not workingaimeos wrote: ↑10 Sep 2023, 08:32 If you have created a manager for a new data domain that contains only one table (and no lists or property table), then you can query the new resource directly over the JSON API. Just configure the new resource in the ./config/client.php file of your extension:See also: https://github.com/aimeos/ai-client-jso ... client.phpCode: Select all
'jsonapi' => [ 'resources => [ 'mydomain' => 'mydomain' ] ]
Re: add new JSON API resouce
Send the CSRF token in the URL of the POST request like for the basket:
https://aimeos.org/docs/latest/frontend ... i/baskets/
https://aimeos.org/docs/latest/frontend ... i/baskets/
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