How Do I Get OneNote Pages to Appear After REST API Create? - rest

I am creating pages in OneNote using OneNote's REST API. For the most part, it works well. However, some pages never show up. According to their HTTP response code (201), they all POST correctly, but no matter when or how many times I run the program, some pages (always the same ones) never appear. Sometimes, if I wait a very long time (e.g. days), a page will finally show up, but usually it disappears again after a while.
Example: if I were to upload 10 pages, I might have 5 that appear in OneNote Online right away, 3 that appear after ten minutes, and 2 that never show up at all (no matter how much I sync), even though they all post to the same place, have unique names, and all return response 201.
If I send a GET request using the ids of the missing pages and include FavorDataRecency: true in the header, the API returns that no such page(s) exist. However, if I leave that header off, then the API returns that they exist as well as their information.
How can I get them to show up?
Update Note: If I delete the sections I'm uploading to and recreate them, then run my program, all the pages POST fine. I have yet to determine if they'll continue to post fine in subsequent runs. For now, it seems to me like something in the way OneNote indexes or caches the pages might be part of the problem. Thoughts?

The symptoms described above:
POST succeeded
Pages do not show up in GET calls
Pages do not show up in OneNote
Imply that your pages did not actually succeed to be created - here are my asks/suggestions:
Ask: Send us the value of the X-CorrelationId header on one of the POST page responses where this symptoms occur so we can debug this.
Suggestion as improvement/temporary workaround: You can retry the POST calls after seeing the pages don't appear.

Related

google ad-sense is not populating the ads in my website

I am trying to populate google ad-sense into my client website and i am using
https://www.npmjs.com/package/angular-google-adsense
With view page source on msbionlineclasses.com you can see on the index page the directive is been called.
Still i am getting a blank item. Let me know the reason?
Update-1
I am getting as AD:1
Usually google starts analysing your website traffic patterns and content type once your adsense code goes live i.e. after implementing it into your HTML page.
For few days (usually 1-2 days), it will only show the empty placeholders, which is the case with you right now I guess.
Wait for 2 days and you will be able to see the results automatically.
P.S. - the usual practice I follow is to have only one adsense implementation in the footer where empty placeholder will not bother the visitors as well as the look of the page. Once it is working, implement as desired.

Google analytics experiment redirect

Hi I have an issue with experiments.
This is my original page: http://cellulem.netlogiq.com/test1.html
and the variations 1: http://cellulem.netlogiq.com/test2.html
The problem is when I access the test1.html page, it redirected me always on the same page, after a few seconds.
I inserted the experiment code right after the head tag, and after that the tracking code.
so any ideas why???
This sounds like expected behaviour. The experiment redirects you to the same page because recurring visitors need to see the same page for every pageview/visits (it would confuse the heck out of your visitors were they to see different pages for every pageview, plus it would ruin your experiment).
Try and delete your cookies between reloads so the Google does not recognize you as recurring visitor. Try at least ten reloads (the code redirects randomly, not alternating - it's not unusual to get the same page four or five times in a row if you just have one variation).
Updated to include the discussion from the comments:
The experiment code only goes into the original page (else there will be unwanted redirects on other pages). If you have a common header in your template you could check if you are on the original page by inspecting the current url, like so:
if(window.location.href === 'original.html ') {
// display experiment code
}

Crazy Facebook UI Dialog Error

So I cannot find any reason I am seeing the below behavior and if anybody has some insight it will be greatly appreciated.
Basically I am using the FB.UI from the JavaScript SDK to send a message to a user with a link. The link ends with a Guid, like http://www.domainname.com/register/33a1a0ae-e0fe-4eb6-9bf9-146d5492e3d6. This works sometimes, but occasionally fails with a generic 500 error from FB.
I have pulled out the HTTP POST request and have found a solution that I can recreate, unfortunately I cannot share the access code to allow SO users to actually run it (I replaced all sensitive parameters). Below are two identical requests that differ only in the Guid. The first succeeds every time and the second fails every time. I have numerous Guids that are doing this which makes if unreliable.
https://www.facebook.com/dialog/send?access_token=XXX&api_key=XXX&app_id=XXX&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df2cb8f5c1ca0402%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent.parent&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df11a615f3b71192%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent.parent&description=test&display=iframe&link=http%3A%2F%2Fwww.domainname.com%2Fregister%2F**33a1a0ae-e0fe-4eb6-9bf9-146d5492e3d6**&locale=en_US&name=test&next=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df22e359d88321ce%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent%26frame%3Df33c13cd4ecc156%26result%3D%2522xxRESULTTOKENxx%2522&picture=http%3A%2F%2Fwww.domainname.com%2Fimg.gif&sdk=joey&to=XXX
https://www.facebook.com/dialog/send?access_token=XXX&api_key=XXX&app_id=XXX&channel=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df2cb8f5c1ca0402%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent.parent&channel_url=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df11a615f3b71192%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent.parent&description=test&display=iframe&link=http%3A%2F%2Fwww.domainname.com%2FFregister%2F**dd171262-dbcc-43c3-b9d1-e37dc53e3520**&locale=en_US&name=test&next=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter.php%3Fversion%3D5%23cb%3Df22e359d88321ce%26origin%3Dhttp%253A%252F%252Fwww.domainname.com%252Ff350c0fd55d5764%26domain%3Dwww.domainname.com%26relation%3Dparent%26frame%3Df33c13cd4ecc156%26result%3D%2522xxRESULTTOKENxx%2522&picture=http%3A%2F%2Fwww.domainname.com%2Fimg.gif&sdk=joey&to=XXX
I tested both of these urls:
http://www.domainname.com/register/33a1a0ae-e0fe-4eb6-9bf9-146d5492e3d6
http://www.domainname.com/register/dd171262-dbcc-43c3-b9d1-e37dc53e3520
with the js sdk send method, and indeed the first url resulted in a 500 from facebook, while the first managed to send it.
I can't understand why the first UID triggers an error while the second does not.
The reason I kept asking for a working example of such urls is that when you share a url using facebook, they scrap that url (unless it's already in their cache) and extract meta data of that url so that a feed story can be composed.
Since the urls that I was trying are not accessible for facebook it might somehow trigger that error.
If I try this url:
http://laine.webhop.org/tresendas/register/33a1a0ae-e0fe-4eb6-9bf9-146d5492e3d6
then it works and I don't get the server error, even though it has the same UID as the first url I tried.
I suggest that you try to use urls accessible to facebook, if you still get errors for certain UIDs, then you should probably open a new bug report.

How to access links provided on one's timeline?

I would like to have access to the links one shared on their timeline.
Using the API Graph Explorer, I see there is a way to access "links". However, it returns empty data. I believe that this might have been used when posting links in FB was done in a special way, different than posting "usual" status.
Then, I thought, I should probably get all the stream and filter the data for links. But at that point, I'm a little confused:
There are THREE different actions that seem to provide the very same data:
- https://graph.facebook.com/me/feed
- .../me/posts
- .../me/statuses
Are they actually all the same?
In addition, all seem to provide me information that is not up to date, but is true for some point in the near past. Moreover, I would like to know how I can get the relevant data from the beginning of the FB usage, or at least, for a given period of time.
Do an HTTP Get to me/links to get the most recent links the user has shared.
To limit it to a timeframe, you can do me/links?since=YYY&until=ZZZ.
Or you can use the paging object to get the previous and next url to use to get that other page of data.

Facebook: Updating page tabs through Javascript SDK

I'm trying to update my tab on a series of pages on facebook. Due to the volume of pages I'm making batch calls to keep from being rate limited. The batch calls work fine.
That being said, I'm trying to Update a page tab by making the call as stated here. I have the adding functionality working fine, and it's operating as it should. I use the same method of getting and using tokens, and I know moreso that it's not an issue as I have offline access so they don't expire (I get them every page load, but in reality could just store them and not worry about it).
Both calls use the same page ID, app ID, and access token and the call is good. The Error I receive is that the tab does not exist on the page, yet when I go to https://graph.facebook.com/PAGE_ID/tabs/APP_ID my tab is there showing itself as on the page. When I post to that I get the error it's not there.
My question is this: Has anyone gotten this working yet and if so what did your call look like and am I missing something?
I would post code, but it's incredibly long and intertwined in my program so it would be difficult to extract it.
There's a slight issue with the page tabs API at the moment that means in some situations you need to prepend your app id in the call with app_ so /PAGE_ID/tabs/app_APP_ID, give this a try and see if it works.