API TroubleshootingLast updated on 06 December, 2020
If you’re running into issues with LogicMonitor’s REST API, this document should help you identify the issue and quickly find a resolution. We’ll make sure this page stays up to date and continue to add possible issues as we come across them. Consider the following:
- If you’re using cURL, try using the -v flag for more detail, like the HTTP status code.
- Are you getting an HTTP 200? If so, the issue likely pertains to incorrect syntax or use of a particular REST resource. Refer to our detailed documentation on the specific resource.
- If you’re getting an HTTP 401 – check your credentials. If you’re sure they are correct – are you using API Tokens? See the section below.
- Are you using Windows command prompt to make cURL requests? See the section below.
LMv1 Authentication Issues
If you’re attempting and failing to authenticate REST API requests with API Tokens:
- Make sure you’ve consulted our example scripts. Typically, issues with API Token authentication can be traced back to an incorrect construction of the signature. Specifically, you need to make sure to use a Hex digest for the HMAC SHA-256 algorithm. These examples illustrate how to construct the signature in various different languages.
- Use the following request parameters in your script and confirm that you get the correct Authentication Header below:
If you aren’t getting the correct Authentication Header, here are a couple of intermediate values that may help you troubleshoot (for the same request parameters listed above):
Making cURL requests with Windows
If you’re using the Windows command prompt to run cURL commands, note that the Windows command prompt doesn’t support single quotes. This can be an issue because JSON data payloads are typically specified with single quotes. As an alternative, you can save the JSON data in a .txt file and use the @filename syntax in your curl command, like so: