414 status code when editing a DataStore on open cloud (python)

Hello,

I was making an open cloud application, but when saving (or trying to), I get a 414 (url too long) error:

    code_post = requests.post(
        headers={
            "x-api-key": api_key,
            "content-type": "application/json"
        },
        url=f"https://apis.roblox.com/datastores/v1/universes/{universe_id}/standard-datastores/datastore/entries/entry?datastoreName={datastore_name}&entryKey={code}",
        data=json.dumps(code_info)
    )

This is exactly what the docs shows:

--request POST \

"https://apis.roblox.com/datastores/v1/universes/3310576216/standard-datastores/datastore/entries/entry?datastoreName=Coins&entryKey=269323" \

I’m not sure what the issue would be here.

HTTP Status Code 414 means that the URI is too long. It usually happens when the query of a GET request is particularly long. From your snippet what could be causing the error might be the entry key which doesn’t align with roblox’s max URI length limit.

What is said limit? Right now, the keys are randomly generated when created to be the persons username and then random 5-15 characters, in my case this one I’m passing through is 30 ch aracters. (because it passes through my username as well in the key)

Is it also possible to pass through the key as a paramater like when doing a GET?

            params={
                "datastoreName": datastore_name,
                "entryKey": code
            }

According to documentation the max length for key names is 50 characters which although for some reason may be different for open cloud endpoints. You could try debugging this by setting shorter keys.

I’m not familiar with python but if that object will be converted into a string and passed as query then yes.

2 Likes

Sorry - seemed like my issue was the API call to my own website, which was returning a paragraph on why the request had failed, and it was trying to pass that through. Seems to work nwo though, thank you!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.