Hi,
I'm developing a software in C++/Qt5 and I would like to create a button, which when u click on it, a "status" is posted on the user own wall.
So I created a facebook app on https://developers.facebook.com/ but I don't know how to configure it.
Also I tried to run via my program this cURL command :

curl -F 'access_token=XXX' -F 'message=test' 

and I have this error :

{"error":{"message":"An active access token must be used to query information about the current user.","type":"OAuthException","code":2500}}

I don't know what it exactly means, but I think it's because the user have to permit to my app the access to his wall. So I decided to make a 'Authorise access to your Facebook account' but I don't know what cURL or C++ command I should use to make it work.

Thank u in advance for your contribution

Dani AI

Generated

Short answer for : modern Facebook platform rules no longer allow a third‑party app to silently publish to a personal profile (the old publishactions flow was removed). The supported approach for a desktop app that wants the user to post to their own timeline is to invoke Facebook’s Share dialog (which sends the user to Facebook to review/confirm the post). If the target is a Facebook Page you control, use the Pages API with a Page access token and the pages* permissions — that still allows server/app posting but requires app review and the correct tokens. (help.opendorse.com)

Practical Qt/C++ workflows (apply to a Windows Qt5 GUI app)

  • If the goal is “let the user share something (status/link) to their own profile”: open the Share Dialog in the user’s browser (the user completes the post on Facebook). Example using Qt to open the dialog URL:
#include <QDesktopServices>
#include <QUrl>
#include <QUrlQuery>

void openFacebookShare(const QString &appId, const QString &href)
{
    QUrl url("https://www.facebook.com/dialog/share");
    QUrlQuery q;
    q.addQueryItem("app_id", appId);
    q.addQueryItem("display", "popup");
    q.addQueryItem("href", href);                // URL to share (Facebook uses OG tags)
    q.addQueryItem("redirect_uri", "https://www.facebook.com");
    url.setQuery(q);
    QDesktopServices::openUrl(url);
}

Note: Facebook does not allow auto‑filling an arbitrary “status” text on behalf of the user; Share dialog behavior and allowed params are documented in the platform docs and examples. (stevenwestmoreland.com)

  • If the goal is “post as a Page” (programmatic): implement Facebook Login, request the pages permissions, get a user access token for a Page admin, call /me/accounts to obtain the Page access token, then POST to /{page-id}/feed with that Page token. Test in Graph API Explorer, keep tokens secure, and complete app review/business verification for production. Example request patterns and required permissions are documented in the Pages API references. (postman.com)

Troubleshooting & cautions

  • While testing, use the Graph API Explorer to inspect tokens and responses. Tokens expire (short vs long lived) — plan token exchange/refresh.
  • Make the app “Live” and request review for any pages/publish permissions needed to operate for other users.
  • If the non‑interactive, background post to a personal profile is essential, convert the profile use to a Page (business scenario) — only Pages retain programmability. (help.opendorse.com)

References

ok forgot about the curl command, I think my access_token does no longer exists. Also forgot about the facebook application I created on https://developers.facebook.com/ .
I just want, from my C++ application running on windows, to post on own facebook wall. I can use cURL executable application.
What are the steps?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.