Can I pass query parameters to my callback URL?

I want pass query parameters to my callback URL. I tried adding it to my callback URL, but it didn't come through.

_oneall.push(['social_login', 'set_callback_uri', "https://myhost.com/callack.php?id=1234&val=xyz" ]);

I'm wondering if there is an option like this which would be appended to the callback URL:

_oneall.push(['social_login', 'set_callback_param', "id=1234&val=xyz" ]);

Best Answer

  • Claude_SchlesserClaude_SchlesserAdministratorOneAll Team
    Answer ✓
    Hi Jack,

    _oneall.push(['social_login', 'set_callback_uri', 'https://myhost.com/callack.php?id=1234&val=xyz']);

    This is actually the correct way to do it. Please note that our system sends a $_POST request to your callback file.
    You nevertheless need to extract your own values using $_GET, as they are appended to the url.

    $_GET['id] and $_GET['val'] should give you 1234 and xyz.

Answers

  • You are correct, it does work as you stated. I guess I didn't test this correctly.
  • Yes, you can pass query parameters in your callback URL, but there’s no separate method like set_callback_param. The correct way is to include them directly in the callback URL itself. The system will still send a POST request, but your parameters remain available via $_GET because they are appended to the URL.

    So your approach is already right, you just need to read them properly on your callback script.

    For example, you can test it with your own url

    Then in your callback file, access them using:

    $_GET['id']
    $_GET['val']

    Just make sure your script is correctly handling both POST (from the provider) and GET (your custom params).

Welcome!

Please sign in to your OneAll account to ask a new question or to contribute to the discussions.

Please click on the link below to connect to the forum with your OneAll account.