Update User Restriction returns status 200 but does not carry action through to universe

I am using OpenCloud API to ban players from my game but it doesn’t actually ban.

TypeScript code (ignore how I’m converting days to seconds):

Roblox API returns status 200 which should mean that the player was banned but they’re not.
image

Expected behavior

Players should be banned because if its returning status 200, it should be successful but evidently isn’t.

image

While this could be unrelated to the bug, I also just wish to point out that startTime and inherited are read-only so such values will have no effect on the actual ban which could lead to other unintended behaviours.

2 Likes

I’ve removed those from the body but still doesn’t work. I get status 200 but nothing happens.
Just to clarify, the in-game Players:BanAsync() does work, just the API isn’t.

Just sent this one to the team!! We’ll update you soon. Thanks for the report :slight_smile:

1 Like

Thank you for the report. We have not been able to reproduce the behavior you’re encountering. We believe that there could be an idempotency key clash where there have been other bans or unbans created with the idempotency key you provided in the API call, which could lead to a 200. Is it possible for you to give us the idempotency key you were using? In the mean time, can you try making the call again with a different idempotency key?

I don’t believe that could be a possibility. There aren’t any existing bans and the idempotency key is a randomly generated uuid with uuid4. Here is a key used that returned 200, but didn’t ban: 0ed1e063-4aa8-450e-9481-4d0cb4faf497

Edit: I set the idempotency key to “HelloWorld” but still didn’t work.

Would you be able to share the steps you guys took to successfully use the API? I’m not sure where to go as I’ve tried the following to no avail: new API key, different universe, different idempotency key.

Resolved! I overlooked what data is sent through the body. The data should be inside gameJoinRestriction like this:
image

I hope changes can be made internally at Roblox for 400 to be returned if the body is malformed. Massive thanks to @MightyPart for pointing out the issue!

1 Like

We are glad you were able to quickly solve this issue on your own. We have created a task to update the API to respond with an error for malformed data. Thank you for taking the time to report this and helping us improve our feature.

2 Likes

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