Solved

Posting a status update to Facebook for a business from the business' website

Posted on 2015-01-29
12
186 Views
Last Modified: 2015-05-06
I'm hoping to be able to write code for a client's website that posts a status update to Facebook on their business Facebook page. Can anyone tell me whether this is possible, and if so, how to do it?

I know how to post a link, but that's not what we want.

The website uses PHP, but the technique should be relatively independent of platform I think.

Thanks!
0
Comment
Question by:Terry Woods
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 3
  • 3
12 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40578978
Terry,

Like a button or a form that posts a specific message to the FB page?
0
 
LVL 13

Assisted Solution

by:Andrew Derse
Andrew Derse earned 333 total points
ID: 40578989
Take a look at this.  PHP driven and works.

http://www.pontikis.net/blog/auto_post_on_facebook_with_php
0
 
LVL 35

Author Comment

by:Terry Woods
ID: 40579070
Yes, Jason. There will some content created by a trusted that we want to post to facebook.

NUKIT, I'll have a look at the link... thanks.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 13

Expert Comment

by:Andrew Derse
ID: 40579082
It may seem like a lot of work, it is, but it's a sure fire way of getting what you want.  Good luck.
0
 
LVL 35

Author Comment

by:Terry Woods
ID: 40579127
It's worth noting I found this with a google search too, though since it's over two years old there's a chance it's stopped working I suppose. I've yet to go through my options in detail...
0
 
LVL 35

Author Comment

by:Terry Woods
ID: 40579147
I wonder if this API call is what I need? It doesn't seem to mention whether it works for business pages though.
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 40579174
Terry, you're on the right track.  Facebook publishes its API exactly for this purpose...you just need to create a dev key and grab one of their sample snippets and adapt it for your use.  page-id is for pages, user-id would be for people.
0
 
LVL 35

Author Comment

by:Terry Woods
ID: 40579224
NUKIT, I'm struggling to get my access token. The instructions at your link provide a method, but I haven't found a way to set the Canvas URL for my app. I don't even know what that is. Do you have any idea?

I think the procedure might be a bit dated now?
0
 
LVL 13

Accepted Solution

by:
Andrew Derse earned 333 total points
ID: 40579892
I wonder if this will help you better.  It's directly from facebook.com.  I created mine connection about 3 years ago, but left the company that needed it so I no longer know if it's working.  That link I previously sent you was similar to how we used to do it.  

https://developers.facebook.com/docs/php/gettingstarted/4.0.0

Here's the information for using PHP...
0
 
LVL 35

Author Comment

by:Terry Woods
ID: 40611207
Jason, how would I create a dev key? I don't remember reading anything about that in all the dox I've seen so far.
0
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 167 total points
ID: 40615884
Go to:

https://developers.facebook.com/apps

and create a new app to join the developer program and get a key.
0
 
LVL 35

Assisted Solution

by:Terry Woods
Terry Woods earned 0 total points
ID: 40763800
Sorry to leave this open for so long. I did eventually get my code working, after I think about 12hrs effort!

Going by memory, the key steps were as follows:
1. Create an App from within Facebook, setting it to recognise the server where it's being tested from
2. Use the Facebook javascript API to connect to facebook/authenticate
3. Use the Facebook javascript API to authorise managing of the page of interest
4. Use the Facebook javascript API to post to it.

For development, I created buttons to do each of the above steps using the onclick attribute within the button element. I had to add lots of debugging that was output to the console to understand what was going on.

I had no luck at all getting the PHP API to authenticate, as it seems to be a requirement to authenticate with js. However it's probably possible to get the token that the Javascript API gets, and pass it on to the PHP code to make use of the PHP API from that point on.

Note also that requesting permission to "Manage" a page is required in order to post to its wall, and a special review of an app is required to be done by Facebook before you can request that permission for a public page, using an app. You don't however need that review done if you own the page yourself.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Adults who share images on social media aren’t the only ones who need to worry about their privacy. Our culture’s tendency to share every move and celebration affects the privacy of our children, too.
The goal of the tutorial is to teach the user how to set up your camera and your microphone in Skype.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question