The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
vB API register_addmember Method Example
I am trying to add a new member using the API. Does anyone have an example on how to do so? I keep getting "Invalid API Signature" errors. I can get the signature to work correctly if I want to use the "member" method. But as soon as I use the "register_addmember" method and change it from GET to POST it throws an error.
I have looked at all the examples out there and have tried them and still can't get past the "Invalid API Signature". The docs don't show anything useful. Any help would be greatly appreciated. Thanks! |
#2
|
|||
|
|||
Quote:
I'm a new user of vBulletin, but I've managed to get this working today on v4.2, so I thought I'd share what I learnt just in case it helps you or someone in the future. The first thing I found on other posts is that there is an bug in api.php in that it only looks at variables sent by GET. Bit of a problem with methods that require POST, such as register_addmember. So make the following change to line 66 of api.php (or your equivalent). Code:
// Remove this //$VB_API_PARAMS_TO_VERIFY = $_GET; // Add this $VB_API_PARAMS_TO_VERIFY = $_REQUEST; Code:
$signtoverify = md5(http_build_query($VB_API_PARAMS_TO_VERIFY, '', '&') . $VB_API_REQUESTS['api_s'] . $client['apiclientid'] . $client['secret'] . $vbulletin->options['apikey']); $vbulletin->input->clean_array_gpc('r', array( 'debug' => TYPE_BOOL, )); if ($VB_API_REQUESTS['api_sig'] !== $signtoverify AND !($vbulletin->debug AND $vbulletin->GPC['debug'])) { //echo ' Should be: ' . $signtoverify . ' md5("' . http_build_query($VB_API_PARAMS_TO_VERIFY, '', '&') . $VB_API_REQUESTS['api_s'] . $client['apiclientid'] . $client['secret'] . '")'; print_apierror('invalid_api_signature', 'Invalid API Signature'.http_build_query($VB_API_PARAMS_TO_VERIFY, '', '&')); They key things I learnt were...
I hope that helps you or someone else. It was a bit painful learning how to use the API with minimal documentation available, but once you get the essentials understood it gets fairly easy. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|