HTTP 500 exception when downloading posts from Facebook Pages

Feb 5, 2014 at 8:28 AM
Edited Feb 5, 2014 at 8:28 AM
last week I run into an unexpected problem with your library. Any time I try to get a post I get the following error:

Get-FBRawData : The remote server returned an error: (500) Internal Server Error.

To be honest, this is the first time I see your library failing like this, so I am pretty sure that this has to do with some changes on the API that make the server to crash somehow ...

On the following link ( ) you will find a full trace of the event running the Get-FBPost command under debug mode (Set-PSDebug -Trace 2). I hope that this can help you somehow:

Further testing has shown me that there is not a problem downloading posts from a "User Account", but from Facebook "Pages".

Could we work together on fixing this issue?
Feb 7, 2014 at 4:46 AM
Thanks Carlos! I was excited to see that you have released a new version of SMSF. I'm looking forward to experimenting with it.

I haven't had any trouble posting. My guess is that your token has expired. Please try getting a new token using New-FBConnection.
New-FBConnection -PageId (Get-FBPage).id
If you are still having trouble, please set $DebugPreference="Continue" and send me the trace. Be careful however, this trace contains the Access Token so you don't want it to become public, unless you like random strangers managing your Facebook account.

If you have feature requests, please post them in the Issues page.


Feb 8, 2014 at 12:45 PM
Hi Jon,

Your solution works! What I was doing used to work. Unfortunately, it is not working anymore. Here it is what I was doing:
Get-FBPage | Select Name, PageId, access_token | Format-List
From that moment on, I picked up and used the Page AccessToken (not the user one) to create a direct connection to that page:
$connection = New-FBConnection -AccessToken <PageAccessToken> -ExtendedToken
$TimeLine = Get-FBPosts -connection $connection
That last line is now consistently returning an HTTP 500 error. However, with your connection method, everything works fine.

1000 thx! Carlos.