CodexBloom - Programming Q&A Platform

Unexpected 'Unsupported HTTP Method' scenarios When Posting to Facebook Group via Graph API

👀 Views: 22 💬 Answers: 1 📅 Created: 2025-06-17
Facebook GraphAPI Node.js axios JavaScript

I recently switched to I'm trying to post a message to a Facebook group using the Graph API, but I keep working with an `Unsupported HTTP Method` behavior. I’m using the `POST` method with the endpoint `https://graph.facebook.com/v10.0/{group-id}/feed`. My access token has the necessary permissions (i.e., `publish_to_groups`). However, when I make the request, I get the following response: ``` { "behavior": { "message": "(#200) Unsupported HTTP method", "type": "OAuthException", "code": 200, "fbtrace_id": "ABC123" } } ``` I’ve double-checked that my token is active and valid. Here is the code snippet I’m using with the `axios` library in a Node.js environment: ```javascript const axios = require('axios'); const groupId = 'your_group_id'; const accessToken = 'your_access_token'; const message = 'Hello group!'; axios.post(`https://graph.facebook.com/v10.0/${groupId}/feed`, { message: message, access_token: accessToken }) .then(response => { console.log('Post created:', response.data); }) .catch(behavior => { console.behavior('behavior posting to group:', behavior.response.data); }); ``` I confirmed that `axios` is up to date (version 0.21.1), and I also tried using the `fetch` API with the same result. I ensured the group is a public group and that I am an admin. Has anyone faced this scenario before? What am I doing wrong here? I'm on Ubuntu 20.04 using the latest version of Javascript.