Page 2 of 2

Re: API Suspened Users

Posted: Fri Oct 02, 2015 2:43 pm
by elicast
now I worked when I put 'do' along the lines of 'echo'

I really want to thank you for your attention

there is a small problem, the last User does not block, only blocks if I write to the end

http://prntscr.com/8mx0ug

but otherwise it is already working as I wanted, thank you

Re: API Suspened Users

Posted: Sat Oct 03, 2015 7:37 pm
by elicast
I'm trying to use around and is not working, only manually.
You have to help me.

Code: Select all

$vst_username = 'admin';
$vst_password = 'NmSmGFbqgH';
$vst_command = 'e-bloquear-users-revenda user1 user2';

    $postvars = array(
      'user' => $vst_username,
      'password' => $vst_password,
      'returncode' => 'yes',
      'cmd' => $vst_command
    );
    $postdata = http_build_query($postvars);

    // Send POST query via cURL
    $postdata = http_build_query($postvars);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'https://66.85.180.37:8083/api/');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
    $answer = curl_exec($curl);

    if ($answer == 0) {
        echo "ok";
    } else {
        echo "Query returned error code: " . $answer . "\n";
    }

Re: API Suspened Users

Posted: Sun Oct 04, 2015 10:26 pm
by tjebbeke
what is the result of $answer? What problem do you have?

Re: API Suspened Users

Posted: Sun Oct 04, 2015 10:49 pm
by elicast
erro 1 E_ARGS Not enough arguments provided