Announcing Datastore APIs for Open Cloud

While trying to create a key, I stumbled accross this error. I am using Aiohttp library for asynchronous code.

{'error': 'INVALID_ARGUMENT', 'message': 'Invalid content length, it should be positive.', 'errorDetails': [{'errorDetailType': 'DatastoreErrorInfo', 'datastoreErrorCode': 'InvalidContentLength'}]}

Full code below:

async def create_key(self, datastore: str, key: str, data, scope=None):
        params = {"datastoreName": datastore, 'entryKey': key}
        if scope:
            params["scope"] = scope
        
        encoded = str.encode(json.dumps(data))
        checksum = hashlib.md5(encoded).digest()
        checksum = base64.b64encode(checksum)
        #print(checksum,"md5")
        #print(type(checksum))
        headers = self._H()
        headers["content-md5"] = str(checksum)
        headers["Content-Type"] = 'application/octet-stream'
        print(len(encoded))
        headers['content-length'] = str(len(encoded))
        CS = aiohttp.ClientSession(headers=headers)
        req = await CS.post(self._objects_url, params=params, data=encoded)
        await CS.close()
        #print(req, "REAL REQ")
        req = await req.json() 
        print(req, "rrl")
        return req

I am unsure why this is happening.

Why are you setting content length?

1 Like

Using aiohttp, the API returns Invalid content length

Content length usually gets set automatically though??

Not with aiohttp tho, it apparently doesnā€™t set it

I used crypto to change my information to md5 64-bit.

1 Like

No API to remove particular version (similar to RemoveVersionAsync)?

No OpenCloud does not support that endpoint.

Hi,

Can you explain the use case for programmatically access developer products? Why thatā€™s import to you?

Hi, this can be useful for systems where instead of the user having to purchase multiple gamepasses and or products by repeatable hitting confirm you could program an API function to create(or find) a developer product that matches the total making it much more user friendly.

We do now have a way to create them using Develop Api but no way to find them (there is a undocumented method that returns the incorrect ID type [Action Needed] Sunsetting api.roblox.com - #8 by Julli4n). And with API keys becoming a thing using Open Cloud it would provide a much safer option to do these actions.

Now personally, I would use a Open Cloud version for my open source purchasing hub that allows users to purchase RBXM files using Robux (No real currency involved) within our cart system to make it so you no longer have to provide a cookie which could pose a security risk.

Are there any plans to increase the rate limit for larger games? Weā€™re hitting 429 (have about 16k CCUS) as weā€™re not able to transfer datastores we allow players to transfer their data over to the new game but we seem to be hitting the limit quite often, we even purchased another server but still not luck.

Are OrderedDataStores going to be added? In particular, I (and Iā€™m pretty sure that others as well) would like to see the GetSortedAsync added.

The API works great and Iā€™ve been using it to manage some of our DataStores, but there is no workaround on how could we get a key (or keys) with the highest (or lowest) value.
ListEntries might sound like a valid workaround (even though very bad) for some people, who donā€™t store too many entries in their OrderedDataStore, but this isnā€™t viable for people who store many entries in their stores.

2 Likes

Thanks for sharing!

Are you talking about building a website that allow users to purchase passes and products with better UX?

Why you need to hit the API to create dev products instead of using the web UI or Studio?

It seems like youā€™d need ways to upload asset to userā€™s account after purchase, and an API to charge Robux, correct?

Hi, have you tried to use multiple API keys? Although less convenient but you can get more quota this way.

This is WIP, but no concrete timeline yet.

2 Likes

Yes, sadly thereā€™s just too much traffic too handle, one option was to just download the entire datastore using Open cloud tools, but the rate limiting is too extreme, would take a year to download.

I think you have misunderstood the point of the system I am talking about.

There is large community of technology groups on Roblox that make scripts/products(for Roblox) and sell virtual licenses to these products using Robux(via devproducts in a game), when these products load up in a game the script contacts an external server to ask if the owner of the game has the license to the product.

One of the biggest pains of these ā€œpurchasing hubsā€ is that if you want to purchase multiple products you go through one-by-one and purchase each one, what I am asking for is a open cloud endpoint that allows access to developer products so in these Roblox hubs you can have a cart system to either find or create a developer product to buy bulk items.

I already have a system that does it, but it uses cookies which is less then ideal especially after the change restricting cookies to certain IP addresses. Example of coding a system like this in Python.

Getting 401 Unauthorized errors when trying to use this API. There arenā€™t any associated error codes for this in the docs, so Iā€™m having a really hard time debugging. Any help?

Make sure that you are using an IP address that is listed in your Accepted IP Addresses and that youā€™re using the correct Key.
image

Any update on OrderedDataStoreā€™s?

1 Like