2016-05-19 20 views
0

我正在使用facebook圖形API發佈即時文章。我完成了以下步驟: 1-獲取具有必要權限的頁面訪問令牌 2-聲明我的網站的URL。這website's網址是由Facebook的 3-接受在圖形API我張貼,與頁面訪問令牌沒有過期使用Facebook Graph API丟失文章的Cannonical URL

{page-id}/instant_articles?development_mode=true&html_source=<html lang="en" prefix="op: http://media.facebook.com/op#"><head><meta charset="utf-8"><link rel="canonical" href="http://{websites´s URL}/instantarticle.html"><link rel="stylesheet" title="default" href="#"><title>Instant Articles</title><meta property="fb:article_style" content="Test Article Style"></head><body><article><header><h1> Instant Articles </h1><h2>Get familiar with your new storytelling tools. Make your media come alive, and keep readers coming back for more</h2><h3 class="op-kicker">Introduction</h3><address>Instant Articles Team</address><time class="op-published" dateTime="2016-2-04T08:00">February 4th 2016, 8:00 AM</time><time class="op-modified" dateTime="2016-2-04T08:00">February 4th 2016, 8:00 AM</time></header><p>Yes, it’s true. Instant Articles open on mobile devices really quickly.</p></body></html> 

4-我得到迴應標識。當我看到這個ID時,圖形api顯示爲

「message」:「缺少文章的規範URL:沒有爲這篇文章指定URL。規範URL需要聲明並放置在HTML中以生成即時文章。有關聲明和插入規範URL的更多信息,請參閱Instant Articles文檔中發佈文章下的URL。

我不在乎什麼問題?任何想法?

謝謝!

回答

0

我發送的html資源不正確。我已經使用Facebook開發人員設置查看了我的源代碼,並且已經與他一起撰寫了即時文章。但是我使用圖形API發佈相同的源代碼,並得到相同的錯誤。

新源爲此

{page-id}/instant_articles?development_mode=true&html_source=<!doctype html><html lang="en" prefix="op: http://media.facebook.com/op#"><head><meta charset="utf-8"><link rel="canonical" href="http://{canonical_url}/instantarticle.html"><meta property="op:markup_version" content="v1.0"></head><body><article><header><h1>Segundo articulo instantaneo</h1><h2>Article Subtitle</h2><time class="op-published" datetime="2014-11-11T04:44:16Z">November 11th, 4:44 PM</time><time class="op-modified" dateTime="2014-12-11T04:44:16Z">December 11th, 4:44 PM</time><address <a rel="facebook" href="https://www.facebook.com/Epfake/">EP Fake</a>EuropaPress Fake</address><address><a>TR Vishwanath</a>Vish is a scholar and a gentleman.</address><h3 class="op-kicker">This is a kicker</h3></header><p> Article content </p><footer><aside>Acknowledgements</aside><small>Legal notes</small></footer></article></body></html> 

謝謝!我希望你的幫助

+0

你是否首先聲明瞭規範URL,因爲上面引用的錯誤消息說...? – CBroe

+0

我可以在Facebook上爲開發者發佈文章,而不會有任何問題。同樣的文章,相同的代碼,我嘗試在圖形API中,我得到的錯誤。 –