Things don’t always go well when using an API for the first time, especially if you’re a beginner and it’s your first time integrating an API into another system. Often documentation is lacking in terms of errors, since it’s easier to anticipate things going right, than things going wrong.
In HTTP, many status codes can give you an idea of what was going on when you called an API. The standardized status codes go from 100 to 511, and all have different meanings, but only the ones from 400 to 511 are about errors. See them here in this handy table.