Improve 401 Unauthorized error messages to clearly indicate missing token

XMLWordPrintable

      Issue Summary

      When sending a POST request to the https://api.trello.com/1/boards/ endpoint with a missing token parameter, the API correctly returns a 401 Unauthorized status, but the response body contains the {"message": "missing scopes"}
      This message is misleading and does not clearly communicate that the request failed due to a missing authentication token, making it difficult for developers to quickly identify and resolve the issue.

      Steps to Reproduce

      1. Obtain a valid Trello API Key (no token).
      2. Send a POST request to the boards endpoint with only the API Key: {{POST https://api.trello.com/1/boards/?key=\ {apiKey}

        &name=TestBoard}}

      3. Observe the response status and body.

      Expected Results

       The API returns a 401 Unauthorized response with a clear and descriptive error message that identifies the authentication issue, for example:

      {"message": "Authentication credentials are missing or invalid. A valid token is required to access this endpoint."}

      Actual Results

      The API returns a 401 Unauthorized response with the following body:

      {"message": "missing scopes"}

      This message does not clearly indicate that a token is missing, causing confusion for developers who may not immediately understand the cause of the error.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Unassigned
              Reporter:
              Alisson Dalmago
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: