I am trying to post a page to OneNote from the Microsoft Graph API, and when I enter in the section id that the page needs in order to post it throws me an error that states:
Page create requests require the content to be multipart, with a presentation part.
My Request header looks like this:
<!-- MyPartBoundary198374 -->
Content-Disposition:form-data; name="Presentation"
Content-Type:text/html
<!DOCTYPE html>
<html>
<head>
<title>A page with <i>rendered</i> images and an <b>attached</b> file</title>
<meta name="created" content="2015-07-22T09:00:00-08:00" />
</head>
<body>
<p>Here's an image from an online source:</p>
<img src="http://..." alt="an image on the page" width="500" />
<p>Here's an image uploaded as binary data:</p>
<img src="name:imageBlock1" alt="an image on the page" width="300" />
<p>Here's a file attachment:</p>
<object data-attachment="FileName.pdf" data="name:fileBlock1" type="application/pdf" />
</body>
</html>
<!-- MyPartBoundary198374 -->
Content-Disposition:form-data; name="imageBlock1"
Content-Type:image/jpeg
<!-- ... binary image data ... -->
<!-- MyPartBoundary198374 -->
Content-Disposition:form-data; name="fileBlock1"
Content-Type:application/pdf
<!-- ... binary file data ... -->
<!-- MyPartBoundary198374 -->
What could be the issue here?
You're missing the initial request:
POST https://graph.microsoft.com/v1.0/me/onenote/sections/{id}/pages
Content-length: 312
Content-type: multipart/form-data; boundary=MyPartBoundary198374
Related
How to implement facebook instant article sdk for php with localhost.I am using graph api to submit my article in facebook but i want to change my html to facebook instant article html automatically.
The only option for integration you will have for localhost dev environment setup will be the GraphAPI ingestion.
And still, you will need to claim URL to get content ingested to that particular page.
Example: yourdomain.com
You can create a dev.yourdomain.com and claim this just for your development environment.
Then you can create Instant Articles using the SDK and use as your canonical URL the dev.yourdomain.com.
Example:
<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8">
<!-- URL of the web version of this article -->
<link rel="canonical" href="http://dev.yourdomain.com/article.html">
<meta property="op:markup_version" content="v1.0">
</head>
<body>
<article>
<header>
<!-- The title and subtitle shown in your Instant Article -->
<h1>Article Title</h1>
<h2>Article Subtitle</h2>
<!-- The date and time when your article was originally published -->
<time class="op-published" datetime="2014-11-11T04:44:16Z">November 11th, 4:44 PM</time>
<!-- The date and time when your article was last updated -->
<time class="op-modified" dateTime="2014-12-11T04:44:16Z">December 11th, 4:44 PM</time>
<!-- The authors of your article -->
<address>
<a rel="facebook" href="http://facebook.com/brandon.diamond">Brandon Diamond</a>
Brandon is a avid zombie hunter.
</address>
<address>
<a>TR Vishwanath</a>
Vish is a scholar and a gentleman.
</address>
<!-- The cover image shown inside your article -->
<!-- TODO: Change the URL to a live image from your website -->
<figure>
<img src="http://example.com/path/to/img.jpg" />
<figcaption>This image is amazing</figcaption>
</figure>
<!-- A kicker for your article -->
<h3 class="op-kicker">
This is a kicker
</h3>
</header>
<!-- Article body goes here -->
<!-- Body text for your article -->
<p> Article content </p>
<!-- A video within your article -->
<!-- TODO: Change the URL to a live video from your website -->
<figure>
<video>
<source src="http://example.com/path/to/video.mp4" type="video/mp4" />
</video>
</figure>
<!-- An ad within your article -->
<!-- TODO: Change the URL to a live ad from your website -->
<figure class="op-ad">
<iframe src="https://www.example.com/ss;adtype=banner320x50" height="60" width="320"></iframe>
</figure>
<!-- Analytics code for your article -->
<figure class="op-tracker">
<iframe src="" hidden></iframe>
</figure>
<footer>
<!-- Credits for your article -->
<aside>Acknowledgements</aside>
<!-- Copyright details for your article -->
<small>Legal notes</small>
</footer>
</article>
</body>
</html>
Any ideas why the rss feed (http://facebook.moiraecreative.co.uk/facebook-test) is not populating either my production or development feed with any articles. all help is greatly appreciated.
You have not formatted as per Facebook guidelines.
Have a look at this: https://developers.facebook.com/docs/instant-articles/reference/
As per guidelines issued by Facebook, your code is not appropriate. It should contain the following code.
<content:encoded>
<![CDATA[
<!doctype html>
<html lang="en" prefix="op: http://media.facebook.com/op#">
<head>
<meta charset="utf-8">
<link rel="canonical" href="http://example.com/article.html">
<meta property="op:markup_version" content="v1.0">
</head>
<body>
<article>
<header>
<!— Article header goes here -->
</header>
<!— Article body goes here -->
<footer>
<!— Article footer goes here -->
</footer>
</article>
</body>
</html>
]]>
</content:encoded>
I need to add a flow player to my MVC website. i have added a video to server. when i directly put src path in tag it shows video file not found
<div class="flowplayer">
<video>
<source type="video/mp4" src="my server file location">
</video>
</div>
In site.Master head file i have added
<head runat="server">
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
<!-- 1. skin -->
<link rel="stylesheet" href="//releases.flowplayer.org/5.4.6/skin/minimalist.css">
<!-- 2. jquery library -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<!-- 3. flowplayer -->
<script src="//releases.flowplayer.org/5.4.6/flowplayer.min.js"></script>
</head>
But when i run this it gets
I would try it with a video from one of the demos on the flowplayer site first.
It may be the video is either encoded incorrectly or the web browser that you tried it on does not support that format.
HTML5 browser support
I have a simple Google maps web application I'm working on. I have purchased a domain name for the application (http://www.jcunav.com), which during my testing, is designed to simply forward to a page which is hosted on my another domain name of mine (http://www.codeemporium.com/experiments/map5.html). Testing on my Android Nexus S, I am noticing strange behaviour however - if I visit http://www.codeemporium.com/experiments/map5.html directly, then the app displays as intended - the map is the size I want and clicking the "About" link brings up a dialog the size I want. If I visit http://www.jcunav.com however (which, keep in mind, simply forwards to http://www.codeemporium.com/experiments/map5.html), the map displays at what looks like a more zoomed out level, and pressing the "About" link at the bottom of the page shows a dialog box which also appears more zoomed out. My question is, what could be causing this to occur, given that all http://www.jcunav.com is doing is forwarding to http://www.codeemporium.com/experiments/map5.html...
Are you certain you aren't frame-forwarding? I examined the page in firebug for each of the links you provided and it appears to me that you are frame-forwarding the URL. This results in your target page being 'wrapped' in a frame when presented to the end user. Odds are high that this is why it is not working for you.
Here is a somewhat lossy version of what is in the forwarded page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>JCU Nav</title>
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</head>
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
-- snip --
</frameset>
</html>
Notice the frame tag:
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
This is what happens when you frame forward.
Since your sizing relies on additions to the HTML tag:
<html class="ui-mobile landscape min-width-320px min-width-480px min-width-768px min-width-1024px">
They do not work in the frame-forwarded version because they are nested inside the frame and not on the root page.
That's because http://www.jcunav.com is not forwarding to http://www.codeemporium.com/experiments/map5.html, it is loading it into a frame:
C:\Documents and Settings\blah>wget -S -O - http://www.jcunav.com/
--01:05:21-- http://www.jcunav.com/
=> `-'
Resolving www.jcunav.com... 66.150.161.141, 69.25.27.173, 63.251.171.80, ...
Connecting to www.jcunav.com|66.150.161.141|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Sun, 01 May 2011 05:01:11 GMT
Server: Apache/2.0.49 (Unix) PHP/4.3.9
X-Powered-By: PHP/4.3.9
Content-Length: 823
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Length: 823 [text/html]
0% [ ] 0 --.--K/s <
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>JCU Nav</title>
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</head>
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
<noframes>
<body>
<h1>JCU Nav</h1>
<br>
<br>
<br>
Click here to enter <a href="http://www.codeemporium.com/experiments/map5.html">http://www.codeemporium.com/e
xperiments/map5.html</a>
<hr>
| Domain Name Registration and Domain Name Forwarding by <a href="http://www.mydomain.com">mydomain.com - Register your
domain name</a>
</body>
</noframes>
</frameset>
</html>
You'll need to actually change that frame set to do the right thing.
I am building a web application using Grails. I decided to use dojo and I added a dojo fisheye menu for begining in the main.gsp so it would be available on all the application's pages.
It works fine for the (home) index.gsp page, but once I select another one, the fisheye menu disapears. If I go back to home it is there. I revised my settings and everything looks ok to me. I am not using anything fancy, just simple things. I am missing something but not able to figure it out.
here is the code in my main.gsp simplified for clarity:
<html>
<head>
...
<g:layoutHead />
<!-- use dojo library ... this has not effect at all -->
<g:javascript library="dojotk"/>
<!-- Load Dojo -->
<script type="text/javascript" src="js/dojotk/dojo/dojo.js"
djConfig="parseOnLoad:true, isDebug:false"></script>
<!-- need fisheye -->
<g:javascript type="text/javascript">
dojo.require("dojox.widget.FisheyeList");
</g:javascript>
<!-- required css for dojo fisheye -->
<style type="text/css">#import "js/dojotk/dojox/widget/FisheyeList/FisheyeList.css";</style>
</head>
<body >
...
<!-- fisheye bar -->
<div id="fisheyebar"><g:render template="/common/fisheyebar"/></div>
<g:layoutBody />
</body>
And here is the _fisheyebar.gsp
<g:javascript>
function load_app(target){
window.location.href=target
}
</g:javascript>
<center >
<div class="outerbar">
<div dojoType="dojox.widget.FisheyeList"
itemWidth="50" itemHeight="50"
itemMaxWidth="200" itemMaxHeight="200"
orientation="horizontal"
effectUnits="2"
itemPadding="10"
attachEdge="top"
labelEdge="bottom"
>
<div dojoType="dojox.widget.FisheyeListItem"
onClick= "load_app('${createLinkTo(dir:'/something')}');"
iconsrc="images/icon_something.png" caption="Web Browser">
</div>
.....
</div>
</div> <!-- outbar -->
</center>
All the pages including the index.gsp have the following:
<head>
<title>some titel</title>
<meta name="layout" content="main" />
</head>
Please not that the usage of template (_fisheyebar) is not the cause, I put the code directly in the main and had the same effect. So what am I missing?
it is in the relative url to dojo's location. it is relative to the root so that's why the index works and not the other pages.
using absolute URLs fixes the problem.
Did you try to move your dojo declaration and imports to your layout template page instead of putting it in your main.gsp ?