This wiki has had no edits or log actions made within the last 45 days and has been automatically marked as inactive. If you would like to prevent this wiki from being closed, please start showing signs of activity here. If there are no signs of this wiki being used within the next 15 days, this wiki will be closed in accordance to the Dormancy Policy (which all wiki founders accept when requesting a wiki). If this wiki is closed and no one reopens it 135 days from now, this wiki will become eligible for deletion. Note: If you are a bureaucrat, you can go to Special:ManageWiki and uncheck "inactive" yourself.

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.