Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is there an API for bbPress


  • Wilbur
    Participant

    @ozu

    Please is there a JSON API for bbPress? If yes how do I access/enable it?

Viewing 13 replies - 26 through 38 (of 38 total)
  • Hi @barryhughes-1,
    Should I start an environment on GitHub for this ? I really really love the idea of the bbPress API. It has been on my radar for a while but lost priority.

    I had this link already saved to get some ideas https://github.com/thenbrent/BB-API

    Pascal.


    Barry
    Participant

    @barryhughes-1

    Sounds like a great idea to me!

    Hi @barryhughes-1,

    I have just checked your snippet and it just works great 🙂
    So for fully public forums, this could be a quick win.

    My only worry is that it does not take into account any bbPress ‘protection’ or ‘permission’. As it’s showing all forums, all topics, it’s not taking into account any specific bbPress settings or filters set. Some great plugins like bbP Private Groups is shielding data from being seen by unauthorised people and this should be extended to the API.

    So I will try from a different angle. Authentication there will be my biggest nightmare probably 🙂
    I have created my GitHub environment and plan to start putting the ideas on the wiki there: https://github.com/ePascalC/bbp-API/wiki

    Please add your ideas !
    Pascal.

    Okay, I have put my first version on https://wordpress.org/plugins/bbp-api/
    Please help me test it (replies should be added in the next days).
    For all further questions/remarks concerning this plugin, please use the support forum of the plugin.
    Pascal.


    jpvanmuijen
    Participant

    @jpvanmuijen

    Hi, this topic has been very helpful in getting the latest replies, thanks Barry & Robin!
    I’m trying to get the topic of the last five replies and later on construct the URL using the topic URL and reply # (kinda like Robin’s shortcode plugin does), but I can’t figure out how to do this.
    I changed $author_id = get_post( $single_item[‘id’] )->post_author to $topic_id = get_post( $single_item[‘id’] )->topic hoping it would return the topic ID, but no luck. Is there a way to retrieve how to target this field?
    Thanks again!


    jpvanmuijen
    Participant

    @jpvanmuijen

    By the way, Pascal, I tried your plugin but it doesn’t seem to work.
    The endpoint I’m trying to use for instance http://example.com/wp-json/bbp-api/stats/ (or any in that scheme) throws a 404, including v1 in the URL just gives a blank page.


    mapofemergence
    Participant

    @mapofemergence

    Hi everybody,
    I was actually starting a topic about this, a few days ago, but my post contains a bunch of links (more than 3) to help contextualize the discussion and it’s still pending approval.
    If moderators can help with that, the link to the topic is:
    https://bbpress.org/?post_type=topic&p=181440
    (I hope it’s not a problem to link it here; in case, feel free to delete or edit this reply)

    I was trying to start writing a first version of a REST API too, as I missed the latest posts by Pascal. Also, I looked for existing code here:
    https://github.com/ePascalC/bbp-API
    but found only empty files. Am I missing something?

    Anyway, I downladed the plugin and checked the code there.
    Mine differs a bit as I was using BP-REST as a starter: I saw they had an extensive discussion about how to frame the whole work and structure it for the longer term, so I thought it was a good idea to take that into consideration.

    If you think we might join efforts on this, let me know; I have limited time to invest on this but I’d be pleased to give my contribution whenever I can.

    Cheers,
    s t e


    mapofemergence
    Participant

    @mapofemergence

    @jpvanmuijen
    Assuming $single_item[‘id’] contains the id of the reply, this should do what you want:
    $topic_id = get_post( $single_item[‘id’] )->post_parent;


    jpvanmuijen
    Participant

    @jpvanmuijen

    @mapofemergence You are right, thanks! I didn’t expect topics and replies to be hierarchical.


    mapofemergence
    Participant

    @mapofemergence

    @jpvanmuijen I started looking at how bbPress works under the hood just recently, so I’m learning these things just by looking into the code and trying to guess. I’m glad I didn’t give a wrong hint 🙂

    I’m not sure if there’s any higher-level logic wrapping this in bbPress functions, though; any experienced bbPress guy is more than welcome to expand on this: I’d be happy to know if there’s a better way.

    Hopefully, with the REST API this sort of tasks will become pretty straight forward 🙂


    tpsr51
    Participant

    @tpsr51

    Hi @casiepa.
    Can you update the github repo with your latest updated version of the plugin?

    I would love to offer my changes and additions to it.


    Pascal Casier
    Moderator

    @casiepa

    Hi,
    Plugin is on https://wordpress.org/plugins/bbp-api/ but let me see to copy the code to GitHub this weekend.
    @jpvanmuijen on 2 of my forums it seems to give stats, but we should have that discussion at the support forum for bbp-api 🙂
    Pascal.


    mapofemergence
    Participant

    @mapofemergence

    Hi there,
    while waiting for the github by @casiepa to be updated, I managed to take some time to (partially) clean what I had written so far.
    I published it on a repo, just in case anybody were interested in taking a look and opening a discussion about desirable ways to approach the problem and to structure the code.

    Here it is:
    https://github.com/mapofemergence/BB-REST

    cheers,
    s t e

Viewing 13 replies - 26 through 38 (of 38 total)
  • You must be logged in to reply to this topic.
Skip to toolbar