- Posts: 50
- Thank you received: 0
Adding a custom API Method
- lorna guttormson
- Topic Author
- Offline
- Senior Member
Less
More
9 months 3 weeks ago #164713
by lorna guttormson
Adding a custom API Method was created by lorna guttormson
Hello
We have tested the API for get subscription details and it works well. Thank you. We would need to create one more API- get details of all subscriptions new or changed since a given date . However, I cannot find a 'last-update-date' in the subscription table? Is there anything that can be queried to determine which subscriptions have been changed recently?
Lorna
We have tested the API for get subscription details and it works well. Thank you. We would need to create one more API- get details of all subscriptions new or changed since a given date . However, I cannot find a 'last-update-date' in the subscription table? Is there anything that can be queried to determine which subscriptions have been changed recently?
Lorna
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
9 months 3 weeks ago #164719
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Adding a custom API Method
Hi Lorna
We do not store modified date of a subscription record at the moment, so that data is not available for query, sorry
Tuan
We do not store modified date of a subscription record at the moment, so that data is not available for query, sorry
Tuan
Please Log in or Create an account to join the conversation.
- Alex P
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 months 3 weeks ago #168017
by Alex P
Replied by Alex P on topic Adding a custom API Method
You can play around with Joomla's Action Logs. It stores all events.
Please Log in or Create an account to join the conversation.
- lorna guttormson
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 50
- Thank you received: 0
3 months 4 days ago #168776
by lorna guttormson
Replied by lorna guttormson on topic Adding a custom API Method
Thank you Tuan for directing me to your API documentation
and thank you Alex P for your suggestion of using the action_logs table. I think this should work. Now - wome 6 months later, I am trying to learn about API,s reading your documentation and working with Postman to see if I can get something going. I have copied model/subscriptions into model/override and entered the query to get a list from actions_log. I would then call api::get from there for each id found. (public function get()). (It seems it is valid to call an api from within another api . Though maybe not too efficient, it would be a start!)
I am confused though about what controller I would copy into the controller/override. Subscriber is all about inserting/updating. I want to be selecting. What should I use here?
Also, when I looked for the examples of overrides, ( github.com/joomdonation/osmembership-ove...verride/register.php ) I get 404's. Do you have any such examples.
and thank you Alex P for your suggestion of using the action_logs table. I think this should work. Now - wome 6 months later, I am trying to learn about API,s reading your documentation and working with Postman to see if I can get something going. I have copied model/subscriptions into model/override and entered the query to get a list from actions_log. I would then call api::get from there for each id found. (public function get()). (It seems it is valid to call an api from within another api . Though maybe not too efficient, it would be a start!)
I am confused though about what controller I would copy into the controller/override. Subscriber is all about inserting/updating. I want to be selecting. What should I use here?
Also, when I looked for the examples of overrides, ( github.com/joomdonation/osmembership-ove...verride/register.php ) I get 404's. Do you have any such examples.
Please Log in or Create an account to join the conversation.
- lorna guttormson
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 50
- Thank you received: 0
2 months 4 weeks ago #168884
by lorna guttormson
Replied by lorna guttormson on topic Adding a custom API Method
Problem solved. In case anyone else is trying this, the problem was two-fold a) not following the instructions VERY carefully and b) not realizing that the code for the final json submission was at last function in the Controller api.php.
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2024 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.