This wiki has been automatically closed because there have been no edits or log actions made within the last 60 days. If you are a user (who is not the bureaucrat) that wishes for this wiki to be reopened, please request that at Requests for reopening wikis. If this wiki is not reopened within 6 months it may be deleted. Note: If you are a bureaucrat on this wiki, you can go to Special:ManageWiki and uncheck the "Closed" box to reopen it.

Handling errors

From RoAPI

Here’s an example of an error returned from the users.roblox.com/v1/users/userId endpoint. You can test this yourself by going to https://users.roblox.com/v1/users/4.

{
  "errors": [
    {
      "code": 3,
      "message": "The user id is invalid.",
      "userFacingMessage": "Something went wrong"
    }
  ]
}

As you can see, it’s an errors list containing objects with a code, message, and userFacingMessage.

  • The code is an identifier used for an error on an endpoint.
  • The message is information about the error intended for the developer.
  • The userFacingMessage is information about the error indented for the user. It isn’t always present and often isn’t as informative as the message.

We can use this code along with the HTTP response code (in this case, 400) and the endpoint’s Response Messages from the documentation to find more information.

An example of the Response Messages on the docs

In this case, it’s just telling us what we already know from the message. There are many cases where the API just doesn't give us useful information, like this:

{
  "errors": [
    {
      "code": 0,
      "message": "Something went wrong with the request, see response status code."
    }
  ]
}

In this case, we don’t get much information - the best we can do is use the documentation to try to figure out what’s wrong here.

This article is a part of the Accessing the Roblox API series.