I am having an issue publishing actions with Facebook’s open graph.
As soon as I remove the app from my user account, and then re allow it, I get the following error:
Error occured
Type: OAuthException
Message: Error validating access token: Session has expired at unix time 1328533200. The current unix time is 1238541149.
Interestingly the session expired time code is the same every time I try and publish an action. I am assuming this is the time code I deauthorised the app.
The code I am using is this: [Private Details Removed]
<script type="text/javascript">
function read() {
FB.api('/me/nmaespace:read' +
'?article=http://domain.com/post.php?id=<?php echo $linkid; ?>&access_token=accesssdfsdfssd',
'post',
function(response) {
var msg = 'Error occured';
if (!response || response.error) {
if (response.error) {
msg += "\n\nType: "+response.error.type+"\n\nMessage: "+response.error.message;
} alert(msg);
} else { alert('Post was successful! Action ID: ' + response.id);}
});
}
</script>
What can I do to stop this happening and make my code work?
Thanks in advance
When you remove an app, its authentication tokens are revoked, permanently.
You need to request that the user re-authorize and collect the new authorization token.