Solved

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

Posted on 2015-01-29
12
169 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
  • 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:NUKIT
NUKIT 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
 
LVL 13

Expert Comment

by:NUKIT
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
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:
NUKIT 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
PHP Variable into a number 3 35
php variable basic question 12 29
Filter wordpress query 3 13
Upgrades AWS EC2 & RDS Boxes 1 12
In this article, you will learn how to create custom audiences using your own email lists. You can use this custom audience as your target audience for advertising on Facebook. This allows you to advertise to your existing audience. Once you've crea…
Follow these tips to boost your freelancing career. Soon enough you'll be enjoying the freedom of being your own boss and working from anywhere.
Viewers will learn how to use the Hootsuite Dashboard.
This Micro Tutorial will give you a basic overview of Skype through its settings, interface, and features.

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now