Reputation: 994
I want to retrieve the facebook video mp4 URL and thumb images using the Facebook copy URL.I am getting 200 error for permissions while getting the video details. My code is given below.Please, anyone, help me to resolve this issue.
https://www.facebook.com/shreyaghoshal/posts/10155774118036484
request= GraphRequest.newMeRequest( AccessToken.getCurrentAccessToken(),
new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(
JSONObject object, GraphResponse response) {
try {
if(object!=null) {
create_facebookID = object.getString("id").toString();
Log.e("facebook" ,"id"+create_facebookID);
new GraphRequest(
AccessToken.getCurrentAccessToken(),
create_facebookID+"_10155774118036484",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.e("response", "res...." + response.toString());
}
}
).executeAsync();
}
}catch (Exception e){
e.printStackTrace();
}
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "id,name,email,gender, birthday");
request.setParameters(parameters);
request.executeAsync();
this is the response I am getting. I want to get video URL.
10-31 10:04:45.203 27233-27233/com.tweak.tweak videos E/response: res....{Response: responseCode: 200, graphObject: {"created_time":"2017-10-09T09:12:56+0000","message":"I think I forgot how to breathe! Heart skipped beats. #PadmavatiTrailer is pure goosebumps. #SanjayLeelaBhansali has created the unthinkable.\nThe poetic magic that he alone can bring to the screens.Deepika Padukone Shahid Kapoor Ranveer Singh bring their best in this film! Music coming soon. Stay tuned.","the story":"Shreya Ghoshal shared Padmavati's video.","id":"11541726483_10155774118036484"}, error: null}
Upvotes: 1
Views: 305
Reputation: 994
After so much time research.I got the solution. Now I can get the video details of the video. I Added keys for the bundle.Now I can get the video details.
if (Youtube_videos.fb_post_url) {
request_fb_post = new GraphRequest(
AccessToken.getCurrentAccessToken(),
create_facebookID + "_10155774118036484",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
Log.e("response", "res...." + response.toString());
}
}
);
Bundle parameters = new Bundle();
parameters.putString("fields", "id,caption ,object_id ,permalink_url ,picture,source,status_type,properties,type ");
request_fb_post.setParameters(parameters);
request_fb_post.executeAsync();
Upvotes: 0