Last active
February 23, 2018 19:58
-
-
Save claudiosanches/5b9ec3f707e5e9fac405 to your computer and use it in GitHub Desktop.
WooCommerce 2.4 - Example of how generate an URL for the API Auth endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$store_url = 'http://example.com'; | |
$endpoint = '/wc-auth/v1/authorize'; | |
$params = array( | |
'app_name' => 'My App Name', | |
'scope' => 'write', | |
'user_id' => 123, | |
'return_url' => 'http://app.com', | |
'callback_url' => 'https://app.com' | |
); | |
echo $store_url . $endpoint . '?' . http_build_query( $params ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment