set_status

set_status($status=6); - report the activation status.

the input Function accepts parameters:

  • $status – activation statuses:
    -1 - cancel activation
    1 - notify when the number is ready (SMS sent to the number)
    3 - request another code (free of charge)
    6 - complete activation(if the status was "code received" - marks successfully and completes, if it was "preparation" - deletes and marks error, if the status was "waiting for a repeat" - switches activation to waiting for SMS)
    8 - notify that the number is used and cancel activation

    After testing, the function returns the result of its work to the script :
  • true – the number is ready
  • false – the number is not ready

    You can view the service response in the smsactivate->answervariable.

    The smsactivate->answer variable can be:

    PHP example: smsactivate->".basename(__FILE__)."
    "; //set the service api key $smsactivate->api_key = '0123456789abcdef0123456789abcdef'; //get phone number if(!$smsactivate->get_phone_number('ot')) { while($smsactivate->answer == "NO_NUMBERS") { $smsactivate->get_phone_number('ot'); sleep(10); } if(strpos($smsactivate->answer, 'ACCESS_NUMBER') === false) { echo("answer $smsactivate->servis $smsactivate->answer
    "); $app->quit(); } } //sms sent $smsactivate->set_status(1); //received phone number echo $phone = trim($smsactivate->number); echo "
    "; /* use the number here in the registration form after which an SMS is sent to the phone */ //wait * 10 in seconds $wt_wait = 7; //get code from SMS if(!$smsactivate->get_code($wt_wait)) { echo("ERROR: $smsactivate->answer could not get code from SMS message"); //inform the service that we release the number $smsactivate->set_status(8); } else//if necessary, correct the parsing of the SMS text, if the code is not correctly parsed from it { //inform the service that everything is ok $smsactivate->set_status(); //code from sms echo trim($smsactivate->code).'
    '; } //end echo "

    "; //Quit $app->quit(); ?>
    Python example: C# example: Java Script example: