Open Cloud error reponses are inconsistent and the documentation is incorrect and lacking

Problem

Open Cloud was meant to solve the issue of using internal undocumented APIs and provide a standardized API. However responses are not inline with the documentation and many objects are undocumented.

Open Cloud v1 errors

According to the docs (Errors | Documentation - Roblox Creator Hub)

Open Cloud v1 APIs share a standard format:

  • An error field, which is a high-level cause that is applicable to all Open Cloud endpoints.
  • An explanatory error message, which further explains the error.
  • An errorDetails object, which covers more information of the error that is specific to each API.

To analyze the root cause of an error, refer to the value of the error field and the errorDetails field. Use the message field as a supplementary for error handling, as sometimes it might not cover the same level of details as the errorDetails field.

There are already 2 issues in this portion of documentation:

  • Error reponses return a code field contrary to what point 1 says
  • The errorDetails object is not documented and is not returned in most responses

The previously quoted docs are immediately followed by this


Here the docs talk about both code and error, which one is correct? You only get the answer by trying it out and seeing that again code is correct.

Furthermore, the aforementioned errorDetails are not documented at all.

Gateway errors

There seems to be a validation layer in front of open cloud APIs, especially around authentication and URL validation.

By sending the following cURL request, the API will return a completely different error format, which is the same one used by legacy APIs.

curl -L -X GET 'https://apis.roblox.com/cloud/v2/users/8883805257/inventory-items?maxPageSize=10' \
    -H "x-api-key: INVALID_KEY"

Response:

{"errors":[{"code":0,"message":"Invalid API Key"}]}

This response is nowhere near the documented ones. The same thing happens if you make the following cURL request:

curl -L -X GET 'https://apis.roblox.com/assets/v1/assets' \
    -H "x-api-key: $KEY"

Yields the following because the resource is not found

{"errors":[{"code":0,"message":""}]}

Open Cloud v2 errors

Going back to the last example, 404 errors get better when the URL points to an inexisting resource on v2:

curl -L -X GET 'https://apis.roblox.com/cloud/v2/users/0'
    -H "x-api-key: $KEY"

Yields the following response which follows the documented format:

{ "code": "NOT_FOUND", "message": "User not found." }

However 404 errors (and other errors caused by invalid requests) caused by an incorrect URL that doesn’t match any endpoint still return the legacy response:

curl -L -X GET 'https://apis.roblox.com/cloud/v2/users'
    -H "x-api-key: $KEY"

Yields:

{"errors":[{"message":"","code":0}]}

Let’s compare two invalid URLs, both expect a number as the last path segment:
https://apis.roblox.com/cloud/v2/users/{ID_NUMBER}
https://apis.roblox.com/assets/v1/assets/{ID_NUMBER}

By sending a string instead of a number as resource ID, the APIs return different responses. V2 returns the documented format while v1 uses the legacy one.

{ "code": "INVALID_ARGUMENT", "message": "Invalid User ID in the request." }
{"errors":{"assetId":["The value 'a' is not valid."]},"type":"https://tools.ietf.org/html/rfc9110#section-15.5.1","title":"One or more validation errors occurred.","status":400,"extensions":{"traceId":"00-427917f0fc3b8375ee33e4603a7f0693-f3f6ad560ff1a122-00"}}

At this point we can say that v2 responses are much better, except not all v1 APIs are available on v2 (e.g assets).

Undocumented objects

The documentation mentions a lot of response objects that are never documented.

Let’s take Create Asset v1 as an example, this is the documented 200 response:


metadata, error and response are objects documented nowhere. How are we supposed to handle these without knowing their structure?

This goes for many other endpoints.

For example I was testing the Get Operation endpoint under the Assets API v1 and only at that point i found out what the response object looks like for it (which is just Asset).

Expected behavior

I expect API responses to be consistent with the documentation and the docs to be exhaustive.

While we can work around the inconsistent responses, being completely blind about returned objects is really frustrating and a major downside. The overall docs make up for a horrible developer experience, especially if you’re writing a wrapper.

6 Likes

After i opened that bug report the docs for error types were updated and the part in the attached picture was added. However after that section was added, v1 error docs were removed so only gateway and v2 errors were documented. Now that change has been reverted and only v1 and v2 errors are documented again.

Hey iKingNInja! Sorry, forgot to follow up after making the change. I’ve only updated the v1 errors page, but have yet to address the fix for the undocumented objects.

The v1 error docs can be found below the v2 error docs, similar to the original categorization. I’m also not able to reproduce the issue of the changes being reverted on my end. Could you provide more screenshots of what you currently see on the page?

Also if you’d like, feel free to make any tweaks here: creator-docs/content/en-us/cloud/reference/errors.md at main · Roblox/creator-docs · GitHub

Hi, apparently my browser had cached the old version of the page, sorry for the confusion

Following up here - you should be able to better see the Assets API v1 endpoint response schemas (as well as for any other OCV1 endpoints with this same issue) under the Feature-based documentation: Assets | Documentation - Roblox Creator Hub

While the documentation has been updated, updating the services themselves to have consistent error responses will take much longer. We’ve added this to our backlog, and will share an update once available.

Thanks for the update, however this issue kind of still applies. Possible @types are not documented anywhere.

Hey iKingNInja,

Regarding consistent error responses, we are planning to consolidate towards a format similar to the following. The below format is consistent with older Roblox Web APIs and our Gateway error responses, and also adopts a few Problem Detail fields from RFC 9457:

{
  "title": "Validation Problem",
  "status": 400,
  "details": "There were validation problems with the request"  
  "errors": [
    {
      "code": 1,
      "message": "The nextPageToken is malformed"
    }
  ]
}

Once we reach sufficient adoption, we can then publish tables of these error codes for each endpoint/service.

Unfortunately I can’t provide an exact date or concrete timeline for the switch - there are many services internally that need to be onboarded, and each service itself may need to follow a migration process to avoid breaking any first/third party consumers.

Regarding OCV1 Asset Upload API docs, I’ve forwarded this to the right team internally to take a second look.

I appreciate your patience, and let me know if you discover any other documentation issues!

1 Like

Following up again - the Open Cloud Assets V1 documentation has been updated to properly reflect the response. Specific error messages aren’t documented yet, however, as they aren’t stable and may drift from the current documentation. You can see the updated documentation here: https://create.roblox.com/docs/cloud/features/assets#/default/Assets_CreateAsset

Since making error responses consistent across all APIs will take a considerable amount of time, I will track this separately internally and close out this bug report. Please let me know if there’s anything I missed.

Hey, I’m also getting an issue like this one.

I’m using the Open Cloud API to automate changing the prices of my developer products (for example when there’s a 25% sale I can automatically deduct -25% off of all the product prices), of course, there are appropriate rate limits and waits in place, but I’m getting an error 415 and I can’t seem to find any documentation of this error anywhere. Are you able to help?

1 Like