After enabling REST API, network, firewall or operating system issues from the system or client can be encountered. How do you test if this is the case or was it the actual REST API service that is not working? |
This knowledge article may contain information that does not apply to version 21.05 or later which runs in a container environment. Please refer to Article Number 000385088 for more information about troubleshooting BMC products in containers. REST API relies on Jetty service embedded in the AR Server. Be sure to follow the configuration steps depicted here: https://docs.bmc.com/docs/ars91/en/configuring-the-rest-api-609071434.html To easily test if the REST API is up without any third party application, run the following commands directly from the server hosting the ARServer. The commands are dependant on the operating system your AR Server is installed to; running the commands directly on the server bypasses any network traffic issues.
curl -Method 'Post' -Uri " http://servername:8008/api/jwt/login" -Body 'username=Demo&password=password' -ContentType 'application/x-www-form-urlencoded' | Select-Object -Expand Content
curl -XPOST -H 'Content-Type: application/x-www-form-urlencoded' -d 'username=Demo&password=password' 'http://servername:8008/api/jwt/login'
For both commands, a successful execution will receive back a token from your AR System; this means that your service is up and running. *Note these command examples are for http protocols, please refer to the curl command documentation for the syntax if using https |