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.

api

eleitheleith New
edited April 2010 in Vanilla 2.0 - 2.8
api

Comments

  • Hi, this API sounds like it may be great, but I am having the hardest time installing it. No matter what I do, it seems like whenever I try to access it, I get this awful "Page Not Found" error. I tried disabling and enabled mod-rewrite, I tried deleting the cache files, and I tried some other things, but nothing works. Does anyone have any idea what I am doing wrong?

    Thank you,

    Richard
  • richard,

    can you give me more information about your install? i'm using this on RC1 right now and it works. I do have mod-rewrite on, but most everything else is default.

    there are other users on the forum that have this working for them too, so what we should do is try and figure out what is different from your install to mine and work from there.
  • Hi Eleith,

    Thanks for responding. I still can't get this to work... I made sure I have RC1 with a fresh install. Vanilla runs properly with or without mod_rewrite. I then uploaded the "api" directory to "/applications/api". I then enabled the API application in Vanilla in the Dashboard ("/index.php/settings/applications").

    Now I can't find a way to access this api. I tried loading following urls in firefox and none worked.

    http://example.com/api/category
    http://example.com/index.php/api/category
    http://example.com/api/session
    http://example.com/index.php/api/session

    Please note that I replaced http://example.com/ with my actual server url.

    Thank you,

    Richard
  • Dang. The vanilla documentation is so sparse it makes me want to cry... but I think I may have just made a break through in debugging this issue.

    After much trial and error, I renamed the controller files to fit a different naming scheme:
    session.php -> class.sessioncontroller.php
    category.php -> class. categorycontroller.php
    etc.

    This seems to load some pages now! However, "api/category/index" gives me this error: "The "Format" class could not be found.".

    Back to debugging...
  • So it seems the Vanilla/Gdn/Dashboard dev team is in the process of changing a lot of class names. In order to get this plugin working I had to rename some references to classes in the controller codes. For example, Gdn_CategoryModel needed to be changed to CategoryModel.
  • oh, that could certainly mess with things.

    yes, there is a lack of documentation (or at least there was when i built this) on integrating apis into vanilla 2 (but this makes sense as vanilla 2 has not been released...)

    does this work for you now?

    if so, could you send me the updated code? i haven't git pulled the latest vanilla, but i guess i should soon...
Sign In or Register to comment.