Skip to Content Skip to Menu

JSON format

3 years 9 months ago #322927 by matthewdavey
JSON format was created by matthewdavey
Is it possible to pull community builder fields in the database to an app in JSON format?
Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48544
  • Thanks: 8290
  • Karma: 1445
3 years 9 months ago #322938 by krileon
Replied by krileon on topic JSON format
You can make your own custom JSON API endpoint for CB using CB Auto Actions. Use a Code action with Method set to PHP, have your PHP return an array of whatever data you like, then under Output select JSON for its display. You should add some sort of security to this though using conditions (e.g. API Key check).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

3 years 9 months ago #322974 by matthewdavey
Replied by matthewdavey on topic JSON format
Could you point me in the right direction on how to set up (e.g. API Key check).

thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48544
  • Thanks: 8290
  • Karma: 1445
3 years 9 months ago #323001 by krileon
Replied by krileon on topic JSON format
Below topic is an example of setting up a custom JSON API endpoint.

www.joomlapolis.com/forum/255-developer-members-support/243474-subscription-licence-key#322990


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

3 years 9 months ago #323069 by matthewdavey
Replied by matthewdavey on topic JSON format
Can you please explain how to can generate the unique ids using the NEWID() SQL function in detail.
So when someone joins the unique Id is generated? For membership number.
The end point I would like would be
Name
User Name
membership/plan = active or inactive True or False
membership/plan expires?
membership Number ( the unique ids using the NEWID() SQL function )

Another thing How do I get the joomla Joomla! 3.9.24 websites API_KEY_HERE ? to set up a pull request?
Or how do I make Or where is the users API_KEY_HERE ?
Thanks

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48544
  • Thanks: 8290
  • Karma: 1445
3 years 9 months ago - 3 years 9 months ago #323088 by krileon
Replied by krileon on topic JSON format

Can you please explain how to can generate the unique ids using the NEWID() SQL function in detail.

See the below MySQL documentation on how to use it's UUID() function to generate a unique ID.

dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_uuid

If I had a custom database table with the name _license_keys then I might have the below for example in a Query auto action.

Code:
INSERT INTO `#__license_keys` ( `user_id`, `key` ) VALUES ( '[user_id]', UUID() )

Another thing How do I get the joomla Joomla! 3.9.24 websites API_KEY_HERE ? to set up a pull request?
Or how do I make Or where is the users API_KEY_HERE ?

You replace API_KEY_HERE with whatever you want. Ideally it should be something you generate something like a password that only you know.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 3 years 9 months ago by krileon.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum