Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6726869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:58:49+00:00 2026-05-26T09:58:49+00:00

Looking over the spring social facebook api, EventOperations offers createEvent(java.lang.String name, java.lang.String startTime, java.lang.String

  • 0

Looking over the spring social facebook api, EventOperations offers

    createEvent(java.lang.String name, java.lang.String startTime, 
                                                      java.lang.String endTime)

to post Events to facebook.

Is there a way to post more information for the event, like event image and event description?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:58:50+00:00Added an answer on May 26, 2026 at 9:58 am

    Looking at createEvent method, it does not currently support the attachment (event image). It does however call into GraphApi publish to actually publish the event:

    public String createEvent(String name, String startTime, String endTime) {
        requireAuthorization();
        MultiValueMap<String, Object> data = new LinkedMultiValueMap<String, Object>();
        data.set("name", name);
        data.set("start_time", startTime);
        data.set("end_time", endTime);
        return graphApi.publish("me", "events", data);
    }
    

    graphApi.publish(…) itself ( which is implemented in FacebookTemplate ) would support anything as a {key,value} pair that Facebook is ready to accept, as it just delegates to the RestTemplate, and feeds all the {key,value} pairs to Facebook through a regular HTTP POST:

    public String publish(String objectId, String connectionType, MultiValueMap<String, Object> data) {
        MultiValueMap<String, Object> requestData = new LinkedMultiValueMap<String, Object>(data);
        URI uri = URIBuilder.fromUri(GRAPH_API_URL + objectId + "/" + connectionType).build();
        Map<String, Object> response = getRestTemplate().postForObject(uri, requestData, Map.class);
        return (String) response.get("id");
    }
    

    Hence you can extend the EventTemplate and add another createEvent method, that would take an image name and an image file path, and would added it as an additional {key,value} to a data MultiMap:

    data.set( "@" + imageName, "@" + imagePath )
    

    Hence the method would look close to:

    public String createEvent( String name, 
                               String startTime, 
                               String endTime,
                               String imageName,
                               String imagePath ) {   // or maybe even "File image", where you would derive the path
        requireAuthorization();
        MultiValueMap<String, Object> data = new LinkedMultiValueMap<String, Object>();
        data.set("name", name);
        data.set("start_time", startTime);
        data.set("end_time", endTime);
    
        data.set( "@" + imageName, "@" + imagePath );  // <<< adding this line
    
        return graphApi.publish("me", "events", data);
    }
    

    This of course does not include any possible validation that you might want to do, etc..
    Once you have this working, which seems to be pretty straightforward, you can donate / contribute it back to Spring Social => they’d be very pleased 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was looking over this code to calculate math.sqrt in Java. Why did they
i've been looking over spring security and noticing how its a pretty big package.
I am looking for a java class that simulates a StopWatch (like Spring's StopWatch
In my PowerShell script, I'm running Select-String over a number of files, looking for
I'm looking over my syllabus for my theoretical computer science class and within the
I'm looking over .NET ORM implementations, and I have a major burning question -
I have been looking over the internet for a while about this, but it
I have been looking over this code for the past hour, I cant see
I was looking over the code for qunit. My question is why would you
So, I was looking over my standard cache utility when preparing to unit test

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.