Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need to add a publish image/video section without usage of the BinaryAttachment #79

Open
nbartels opened this issue Oct 19, 2016 · 2 comments

Comments

@nbartels
Copy link
Contributor

Publishing file with file_url parameter instead of a BinaryAttachment

restfb/restfb#606

@nbartels
Copy link
Contributor Author

Publish image example

DefaultFacebookClient client =
        new DefaultFacebookClient(pageAccessToken, Version.VERSION_2_5);
JsonObject result = 
     client.publish("<page id>/photos", 
             JsonObject.class,
             Parameter.with("message", "This is a cool test image"), 
             Parameter.with("url",imageUrl)
      );

@nbartels
Copy link
Contributor Author

Publish video example

DefaultFacebookClient client =
        new DefaultFacebookClient(pageAccessToken, Version.VERSION_2_5);
JsonObject result = 
         client.publish("<page id>/videos", 
               JsonObject.class,
               Parameter.with("message", "This is a cool test video"),            
               Parameter.with("file_url",imageUrl)
         );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant