Getting error: Session Expired while making a post request

ยอดดู 206 ครั้ง
ข้ามไปที่ข้อความที่ยังไม่อ่านรายการแรก

Theval

ยังไม่อ่าน,
8 มี.ค. 2555 14:27:338/3/55
ถึง RestFB
I am just a beginner using RestFB API. I have imported the project in
my eclipse IDE and while I try to run the sample
(GraphPublisherExample) with my access code I get the following error:

* Feed publishing *
9 Mar, 2012 12:54:33 AM com.restfb.DefaultWebRequestor executePost
FINE: Executing a POST to https://graph.facebook.com/me/feed with
parameters (sent in request body): message=RestFB
test&access_token=AAACEdEose0cBADC3y8tfxXolQxmRPuoGH1ZBwIzPw9YTZB08jmfBrZClYoW0AEqCNIwJYsHj20Aqwli75tVwgAWybzTMYydjAWx0KNvlAZDZD&format=json
Exception in thread "main"
com.restfb.exception.FacebookOAuthException: Received Facebook error
response of type OAuthException: Error validating access token:
Session has expired at unix time 1331233200. The current unix time is
1331234674.
at com.restfb.DefaultFacebookClient
$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:
639)
at
com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:
561)
at
com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:
505)
at
com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:
468)
at
com.restfb.DefaultFacebookClient.publish(DefaultFacebookClient.java:
289)
at
com.restfb.DefaultFacebookClient.publish(DefaultFacebookClient.java:
297)
at
com.restfb.example.GraphPublisherExample.publishMessage(GraphPublisherExample.java:
84)
at
com.restfb.example.GraphPublisherExample.runEverything(GraphPublisherExample.java:
72)
at
com.restfb.example.GraphPublisherExample.main(GraphPublisherExample.java:
64)

Can anyone please guide me?

Cheers,
Theval

Theval

ยังไม่อ่าน,
8 มี.ค. 2555 14:41:578/3/55
ถึง RestFB
I worked around with getting new access code. Just to move on.

But now I am stuck at this point:

* Feed publishing *
9 Mar, 2012 1:09:45 AM com.restfb.DefaultWebRequestor executePost
FINE: Executing a POST to https://graph.facebook.com/thevalparekh/feed
with parameters (sent in request body): message=RestFB
test&access_token=AAACEdEose0cBAOtXrAjlwelfPWmbhJmtpc3zdnH3J0NT5JIOGqyngO0UlvwSbD9JC18Sgf16yqx4o0PYFSSNs3uQRM82bTljGTZCVsgZDZD&format=json
Exception in thread "main"
com.restfb.exception.FacebookOAuthException: Received Facebook error
response of type OAuthException: (#200) The user hasn't authorized the
application to perform this action
at com.restfb.DefaultFacebookClient
$DefaultGraphFacebookExceptionMapper.exceptionForTypeAndMessage(DefaultFacebookClient.java:
639)
at
com.restfb.DefaultFacebookClient.throwFacebookResponseStatusExceptionIfNecessary(DefaultFacebookClient.java:
561)
at
com.restfb.DefaultFacebookClient.makeRequestAndProcessResponse(DefaultFacebookClient.java:
505)
at
com.restfb.DefaultFacebookClient.makeRequest(DefaultFacebookClient.java:
468)
at
com.restfb.DefaultFacebookClient.publish(DefaultFacebookClient.java:
289)
at
com.restfb.DefaultFacebookClient.publish(DefaultFacebookClient.java:
297)
at
com.restfb.example.GraphPublisherExample.publishMessage(GraphPublisherExample.java:
85)
at
com.restfb.example.GraphPublisherExample.runEverything(GraphPublisherExample.java:
73)
at
com.restfb.example.GraphPublisherExample.main(GraphPublisherExample.java:
64)

Please guide me if you have any idea about the above error message.

kfir ozer

ยังไม่อ่าน,
8 มี.ค. 2555 17:34:598/3/55
ถึง res...@googlegroups.com
Hi!

lets start with your first error. 

when you fetch an access token it expires at some point. you need to fetch the expiration date and handle it properly.

more information can be found here:


regarding your new error. it just means that this specific user did not allow the application to fetch his feeds.

more information regarding Facebook app permissions can be found here:
--
Free your software, and your ass will follow 

   -- Laurent Szyster
ตอบทุกคน
ตอบกลับผู้สร้าง
ส่งต่อ
ข้อความใหม่ 0 รายการ