submitSurvey + PHP - Getting authentication error

Options
Hi there,


I'm using the Convio Open API PHP Library to make a call to submit a survey, however it keeps returning the following error:

"Error: The requested method is not allowed ... Method must come from a white-listed IP address or provide an auth token."


I have added both my servers IP address and my own to the API whitelist which has been confirmed by Blackbaud support, but it still wont go through.


I was advised by one of the developers to try and get an authentication token via the getLoginUrl method, and send that through as an auth parameter as well and unfortunately it doesn't seem to work either.


Has anyone been able to implement a survey submission using PHP instead of the Luminate Extend javascript library or be able to point me in the right direction?


==========

Update:


Nevermind. It looks like I figured out a solution by using the sso_auth_token


https://secure3.convio.net/xxx/site/SRConsAPI?method=getSingleSignOnToken


After you get the token from that, you can just pass it through with the post data.


$baseData = http_build_query(array('v'=>$this->v,'api_key'=>$this->api_key,'response_format'=>$response_format,'login_name'=>$this->login_name,'login_password'=>$this->login_password,'method'=>$this->__method, 'sso_auth_token' => $auth));
Tagged:

Comments

  • Asitha de Silva:

    Hi there,


    I'm using the Convio Open API PHP Library to make a call to submit a survey, however it keeps returning the following error:

    "Error: The requested method is not allowed ... Method must come from a white-listed IP address or provide an auth token."


    I have added both my servers IP address and my own to the API whitelist which has been confirmed by Blackbaud support, but it still wont go through.


    I was advised by one of the developers to try and get an authentication token via the getLoginUrl method, and send that through as an auth parameter as well and unfortunately it doesn't seem to work either.


    Has anyone been able to implement a survey submission using PHP instead of the Luminate Extend javascript library or be able to point me in the right direction?


    ==========

    Update:


    Nevermind. It looks like I figured out a solution by using the sso_auth_token


    https://secure3.convio.net/xxx/site/SRConsAPI?method=getSingleSignOnToken


    After you get the token from that, you can just pass it through with the post data.


    $baseData = http_build_query(array('v'=>$this->v,'api_key'=>$this->api_key,'response_format'=>$response_format,'login_name'=>$this->login_name,'login_password'=>$this->login_password,'method'=>$this->__method, 'sso_auth_token' => $auth));


    I am already stealing this as a starting point for some work I want to do. Were you able to make any further progress with SSO?

  • William Tam:

    Asitha de Silva:

    Hi there,


    I'm using the Convio Open API PHP Library to make a call to submit a survey, however it keeps returning the following error:

    "Error: The requested method is not allowed ... Method must come from a white-listed IP address or provide an auth token."


    I have added both my servers IP address and my own to the API whitelist which has been confirmed by Blackbaud support, but it still wont go through.


    I was advised by one of the developers to try and get an authentication token via the getLoginUrl method, and send that through as an auth parameter as well and unfortunately it doesn't seem to work either.


    Has anyone been able to implement a survey submission using PHP instead of the Luminate Extend javascript library or be able to point me in the right direction?


    ==========

    Update:


    Nevermind. It looks like I figured out a solution by using the sso_auth_token


    https://secure3.convio.net/xxx/site/SRConsAPI?method=getSingleSignOnToken


    After you get the token from that, you can just pass it through with the post data.


    $baseData = http_build_query(array('v'=>$this->v,'api_key'=>$this->api_key,'response_format'=>$response_format,'login_name'=>$this->login_name,'login_password'=>$this->login_password,'method'=>$this->__method, 'sso_auth_token' => $auth));


    I am already stealing this as a starting point for some work I want to do. Were you able to make any further progress with SSO?

    If anyone's interested, I was able to get this working (thanks for the work on this Asitha, super helpful). I've updated the PHP library to include SSO auth in both the ConvioOpenAPI.php file, and example.php.


    Let me know if you have any questions!

Categories