Facing “Blocked” Error When Trying to Submit a Post via Reddit API, Other Endpoints Work Fine

I’m currently working on integrating Reddit’s API into my application, and I’m running into an issue when trying to submit a post using the /api/submit endpoint. I have already ensured that my OAuth token includes the necessary scopes: identity, submit, and flair.

The Problem:
Whenever I try to submit a post using the /api/submit endpoint, I receive a 403 Forbidden response with the message “Blocked.”
Token and Scopes: I’ve ensured that my OAuth token includes the necessary scopes (identity, submit, flair), and other API endpoints, such as fetching user data and subreddit information, work perfectly fine with the same token.

User-Agent: I’m using a unique and descriptive User-Agent string as recommended.

I’m able to successfully use other endpoints with the same access token without any issues.
My application is registered and follows Reddit’s API guidelines and rate limits.

export const submitRedditPost = async (req, res) => {

    logInfo(`Attempting to post on Reddit for user ${req.userId}`, path.basename(__filename), submitRedditPost);

    const {
        subreddit, title, text, kind = 'self', url = "", nsfw = false, spoiler = false, sendreplies = true, flairId, flairText,
    } = req.body;

    const { Reddit_accessToken } = req.body;

    const modhash = req.headers['x-modhash'] || '';
    try {
        const params = new URLSearchParams({
            api_type: 'json',
            sr: subreddit, // Only include subreddit if present
            title: title,
            kind: kind,
            nsfw: nsfw,
            spoiler: spoiler,
            sendreplies: sendreplies,
        });


        if (kind === 'self') {
            params.append('text', text); // Add text for self-posts
        } else if (kind === 'link' && url) {
            params.append('url', url); // Add URL for link posts
        }

        if (modhash) {
            params.append('uh', modhash);
        }


        if (subreddit && flairId && flairText) {
            params.append('flair_id', flairId);
            params.append('flair_text', flairText);
        }

        console.log(params)

        const response = await fetch('https://oauth.reddit.com/api/submit', {
            method: 'POST',
            headers: {
                'Authorization': `Bearer ${Reddit_accessToken}`,
                'User-Agent': process.env.USER_AGENT,
                'Content-Type': 'application/x-www-form-urlencoded',
            },
            body: params.toString(),
        });



        if (!response.ok) {
            const contentType = response.headers.get('content-type');
# const errorText = contentType && contentType.includes('application/json')
                ? await response.json()
                : await response.text();

            logError(`Failed to post on Reddit: ${response.status} - ${response.statusText} - ${JSON.stringify(errorText)}`, path.basename(__filename));
            return res.status(response.status).json({ message: `Failed to post on Reddit: ${response.statusText}`, error: errorText });
        }

        const responseData = await response.json();
        console.log(`Response Data: ${JSON.stringify(responseData)}`);

        if (responseData && responseData.json && responseData.json.errors && responseData.json.errors.length > 0) {
            logError(`Reddit API error: ${JSON.stringify(responseData.json.errors)}`, path.basename(__filename), submitRedditPost);
            return res.status(400).json({ message: "Error from Reddit API", errors: responseData.json.errors });
        }
    logInfo(`Successfully submitted post to Reddit: ${responseData.json.data.url}`, path.basename(__filename), submitRedditPost);
    res.status(201).json({ message: "Post submitted successfully", url: responseData.json.data.url });
} catch (error) {
    logError(`Error submitting post to Reddit: ${error.message}`, path.basename(__filename));
    res.status(500).json({ message: "Internal server error", error: error.message });
}

};

`

Has anyone faced a similar issue or could provide any insights on what might be causing this “Blocked” error specifically on the /api/submit endpoint? Any help would be greatly appreciated!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật