vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   VBulletin REST API api.init error (https://vborg.vbsupport.ru/showthread.php?t=322124)

jpr 03-15-2016 03:12 PM

VBulletin REST API api.init error
 
Hello,
We have a CGI script that invokes vBulletin REST API functions. It was working fine for a while. Without any changes to my code whatsoever, but with possible modifications to the vBulletin configuration (but not by me), invoking api.init is not giving me the response that I am expecting.

I am passing all of the correct parameters (as I mentioned it was working fine and there have been no code changes since then). I used to get a JSON response HASH like this:

{
'show' => {
'registerbutton' => 1
},
'permissions' => [],
'features' => {
'taggingenabled' => 1,
'blogenabled' => 1,
...
}

But now I am getting this response. Any idea why I would get such (a very unhelpful) response? I'm stumped. I must assume it has to do with vBulletin 5 configuration because the code has not changed one bit. Here is the response that I am currently getting:
[
[
'node_permission',
2,
'node'
]
]

I verified that the API is enabled and that the API key is correct (although the API key is not sent to api.init). I searched everywhere and found nothing. Any help/tips would be appreciated.

--------------- Added [DATE]1458069943[/DATE] at [TIME]1458069943[/TIME] ---------------

vBulletin support was no help. I had to read the vBulletin code, line by line, to figure this out.

SOLUTION:
In admincp, select "Channel Permissions", under 'Forum', click [Edit] for "Unregistered/Not Logged In", and set "Can View Channels" option to Yes.

I don't know why setting it to No breaks the API, but it does. In my opinion this was a horrible design choice.


All times are GMT. The time now is 05:57 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00959 seconds
  • Memory Usage 1,707KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete