(Python) Your post was empty, white space, or more than 500 characters

I’m trying to create a POST request to create a new message on a group wall. I’m getting the error which was specified in this title. I’m using Python.

def group_post(group_id, msg):
    r = session.post(
        url = "https://groups.roblox.com/v2/groups/" + str(group_id) + "/wall/posts",
        headers={
            "Cookie": ".ROBLOSECURITY=" + Cookie,
            "Content-Type": "application/json",
            "Accept": "application/json",
            "X-CSRF-TOKEN": requests.post(auth, cookies={".ROBLOSECURITY": Cookie}).headers["x-csrf-token"],

        },
        data =  {"body": msg},
        allow_redirects = False
    )
    print(r.json())

(post deleted by author)

There’s been other posts relating to Python, JavaScript, and other programming languages. It’s still related to Roblox.

1 Like

@zCrxtix Although mac isn’t wrong with this scripting support isn’t limited to JUST Luau. Although you may have higher chances of getting a faster response through another site native to python.

1 Like

This is still related to Roblox. Most people on stack overflow don’t know how the roblox API works.

What is the message you are sending?

Any message, no matter what I put, this error happens.

Still confused on why this error is happening.

I hate to ask, but are you actually for sure positive msg is not some how being nothing? Try printing msg inside the group_post function just to see.

I have. The function is being called in another script, and passing in an input as the message.

The error doesn’t lie; I know little to nothing about python (I really only use Lua and JavaScript), but try passing a random string into the function as the message, and watch it output. (Either the string, or the error.)

Also, you’re trying to print the entire post, which may also be causing the error. (The cookie is over 900 characters, and you’ve got to include the other characters found in the variable “r”.)

Those are my two guesses as to why this is happening to you!

This is my updated code:

def group_post(group_id, msg):
    print(group_id, msg)
    r = session.post(
        "https://groups.roblox.com/v2/groups/" + str(group_id) + "/wall/posts",
        headers={
            "Cookie": ".ROBLOSECURITY=" + Cookie,
            "Content-Type": "application/json",
            "Accept": "application/json",
            "X-CSRF-TOKEN": requests.post(auth, cookies={".ROBLOSECURITY": Cookie}).headers["x-csrf-token"],
        },
        data =  json.dumps({"body": msg}),
    )  
    print(r.json())

I’m getting a new error:

Now I’m getting Token Validation Failed.

Apologies for the late reply!

The system can’t actually solve a captcha (unless you implement a system to solve it, which may affect performance), so you’ll have to somehow find a way to bypass it. Possibly it’s sending too many requests? Try going on the account, solving the captcha for the first time, and maybe next time it won’t ask for it?

(Though the whole point of a captcha is to prevent bots, lol- :joy:)

When I post any message on the group, it doesn’t even ask me for a captcha.

Interesting? It’s possibly sending too many requests to Roblox? I honestly don’t really know-

Agreed. Sometime bots/new acc/alt acc need to pass some captcha test before they can do thing such following user, posting on group wall and ETC.
This captcha test rarely happen to account that used for a while, which is pretty convenient.

Captcha must be solved at this point, using an account that has an email,played some experience or older. If this method worked, try to have a medium delay between group wall posts otherwise you might need to redo the captcha again.

I’m using my account for this.

1 Like

You should not be attempting to use endpoints that require a captcha to be solved first. You are always solving captchas when using this endpoint normally, they are just sometimes invisible if FunCaptcha determines you are not a bot based on various factors. Attempting to bypass this captcha is against the TOS since there is a reason it exists, so you should not go any further.