in cake php 1.3 in view ctp i have follow code:
$url = 'http://example.com/exmp/explus/books/view/'.$book['Book']['id'];
echo $this->Html->meta(array('property' => 'fb:app_id', 'content' => '*******'),'',array('inline'=>false));
echo $this->Html->meta(array('property' => 'og:type', 'content' => 'book'),'',array('inline'=>false));
echo $this->Html->meta(array('property' => 'og:url', 'content' => $url ),'',array('inline'=>false));
echo $this->Html->meta(array('property' => 'og:title', 'content' => $book['Book']['title']),'',array('inline'=>false));
echo $this->Html->meta(array('property' => 'og:description', 'content' => $book['Book']['title']),'',array('inline'=>false));
$imgurl = '../image/'.$book['Book']['id'];
echo $this->Html->meta(array('property' => 'og:image', 'content' => $imgurl ),'',array('inline'=>false)); ?>
and it gives the following error when i am posting it’
{
"error": {
"message": "(#3502) Object at URL http://example.com/exmp/explus/books/view/234' has og:type of 'website'. The property 'book' requires an object of og:type 'book'. ",
"type": "OAuthException",
"code": 3502
}
}
is any one know how to solve it?
This issue can occur if your page is restricted for logged in users or has some sort of session logic.
You can use the debug tool from this link :
http://developers.facebook.com/tools/debug
In that link you can give your url (http://example.com/exmp/explus/books/view/234) in the
"Input URL, Access Token, or Open Graph Action ID"Field.After that on clicking the debug button if you are able to see the values for
fb:app_id,og:url,og:type,og:title, this issue would not occur.Else you can check the
"URLs"section at the bottom of the page and click the"See exactly what our scraper sees for your URL"link.On clicking the link you can see the html code of your site in the browser. That will help you to debug the issue.