How to use GET in PHP with OneNote API? -
i've got onenote api php sample (thanks jamescro!) working post examples, there's no example , haven't managed put code of own works. here's i've tried without success:
// use page id returned post $pageid = '/0-1bf269c43a694dd3aaa7229631469712!93-240bd74c83900c17!600'; $initurl = url . $pageid; $cookievalues = parsequerystring(@$_cookie['wl_auth']); $encodedaccesstoken = rawurlencode(@$cookievalues['access_token']); $ch = curl_init($initurl); curl_setopt($ch, curlopt_url, $initurl); // set url download curl_setopt($ch, curlopt_returntransfer, true); $response = curl_exec($ch); if (! $response === false) { curl_close($ch); echo '<i>response</i>: '. htmlspecialchars($response); } else { $info = curl_getinfo($ch); curl_close($ch); echo '<i>error</i>: '; echo var_export($info); }
it returns 'error' info dump. doing wrong?
without information on specific error i'm not sure issue hitting. try looking @ php wordpress plugin here: https://github.com/wp-plugins/onenote-publisher/blob/master/api-proxy.php
look @ sent wp_remote_get - there necessary headers needed.
also make sure have scope "office.onenote" when request access token.
if need more help, please add information specific url attempting call, contents of headers. if have errors, please include output.
Comments
Post a Comment