Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Interaction with Vanilla outside of it

WargogWargog Mifflinburg, PA New

Hi, I was just wondering, is there any way to interact with Vanilla, things like grabbing profile pics, seeing if the user is logged in and displaying a message if they're not? Using what I've put here, like displaying a link to the users settings page and displaying their profile pic if they're logged in, or displaying the login button if they're not?

Comments

  • x00x00 MVP
    edited April 2015

    There are two API one is available as an App, with the upcoming 2.2 version which atomic and based on models, which is useful for write operations.

    There is a basic one user normal controller an need no api key.

    http://vanillaforums.org/profile.json

    See what happens when you are not logged on.

    Note "Logged on" is not a state, HTTP is stateless. One is only logged on by virtue of a session cookie which comes with every request. There no such persistent state on the server (even if you can imply it under some systems).

    If you are same domain session can be respected, through JavaScript. you can't do this on the server as it is the browser than has the cookie. If you stick to client-side scripting it makes it easier.

    grep is your friend.

  • You can also use that api to fetch vanilla modules, and you you can create your own modules.

    grep is your friend.

  • WargogWargog Mifflinburg, PA New

    I don't see that file on my forum installation. Is it a plugin or something that I should use?

  • WargogWargog Mifflinburg, PA New

    I have definitely done a lot of programming before, I'm just getting into how different thing interact with the web though. Web programming is a lot different than desktop programming. Would this work using GET requests? http://vanillaforums.org/addon/api-application

  • WargogWargog Mifflinburg, PA New

    Nevermind, it's for Vanilla 2.2, anything else I could use?

  • R_JR_J Ex-Fanboy Munich Admin

    It's like @x00 told: you can use json files. Look at the differences between these two links:
    http://vanillaforums.org/profile.json/56203/Wargog
    http://vanillaforums.org/profile.json/44046/R_J

    If you are logged in and you open your own profile with the above link, you'll find a "transient: ...". entry. You would need to make an AJAX call so that it could work.
    Another page you could check from within an AJAX call would be http://vanillaforums.org/module/memodule.json

Sign In or Register to comment.