Start here

Home
About Klocwork
What's new
Fixed issues
Release notes
Installation

Reference

C/C++ checkers
Java checkers
C# checkers
MISRA C 2004 checkers
MISRA C++ 2008 checkers
MISRA C 2012 checkers
MISRA C 2012 checkers with Amendment 1
Commands
Metrics
Troubleshooting
Reference

Product components

C/C++ Integration build analysis
Java Integration build analysis
Desktop analysis
Refactoring
Klocwork Static Code Analysis
Klocwork Code Review
Structure101
Tuning
Custom checkers

Coding environments

Visual Studio
Eclipse for C/C++
Eclipse for Java
IntelliJ IDEA
Other

Administration

Project configuration
Build configuration
Administration
Analysis performance
Server performance
Security/permissions
Licensing
Klocwork Static Code Analysis Web API
Klocwork Code Review Web API

Community

View help online
Visit RogueWave.com
Klocwork Support
Rogue Wave Videos

Legal

Legal information

Klocwork Web API cookbook

The Klocwork Web API provides administrators with a scriptable interface to the Klocwork database. For examples relating to detected issues and metrics, see Issue and metric API examples. For examples relating to access control, see Access control API examples.

By default, access to the Web API is granted to Project Root Administrators and Project Administrators. You can grant permission for other users to access the Web API using the roles tab in Klocwork Static Code Analysis or through the Access Control API.

The API allows you, for example, to generate lists of detected issues and create views.

Use of the API is as simple as posting an HTTP request to the following URL:

http(s)://<klocwork_server_host>:<klocwork_server_port>/review/api
Note: Use https:// if a secure Klocwork Server connection has been configured.

The output is in the form of JSON records. For more information about JSON, see http://www.json.org/.

You can place the HTTP requests with a utility as simple as curl, or with the scripting language of your choice. Running curl will allow you to read the JSON output, but if you want to further process the output, you'll need to use a scripting language such as Python or Ruby. You can write scripts in any language that supports sending POST HTTP requests and that processes JSON output. All of the examples in this article use curl.