How to use curl commands to hit WS API endpoints in CA Agile Central On-Premises

Document ID : KB000057540
Last Modified Date : 14/02/2018
Show Technical Document Details


The KnowledgeBase articles that show examples of curl commands use API Key authentication that is not supported yet On-Premises.


In on-premises environment a basic username:password authentication can be used with curl commands.
However, since CA Agile Central on-premises instances come with self-sign certificate, SSL certificate problem: Invalid certificate chain is expected unless curl's verification of the certificate is turned off.
Here is an example of an endpoint used with curl where an on-premises server is and ObjectID of a user story is 52542:

curl -u '!'

Here is the response:

curl: (60) SSL certificate problem: Invalid certificate chain
More details here:

curl performs SSL certificate verification by default, using a "bundle"
?of Certificate Authority (CA) public keys (CA certs). If the default
?bundle file isn't adequate, you can specify an alternate file
?using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
?the bundle, the certificate verification probably failed due to a
?problem with the certificate (it might be expired, or the name might
?not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
?the -k (or --insecure) option.

Using -k option will allow request to go through:

curl -k -u '!'

Here is the response shortened for brevity:

{"QueryResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": [], "Warnings": [], "TotalResultCount": 9, "StartIndex": 1, "PageSize": 20, "Results": [{"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "_ref": "", ...., "Project": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "_ref": "", "_refObjectUUID": "4cc7c51a-794f-48e9-955a-2a49263e8...}

If you are not sure how to construct a valid endpoint, follow an example below. A valid endpoint can be constructed by a direct query in WS API:

In this example WS API interactive documentation is located here:

In your case it will follow this syntax:

https://<your server>/slm/doc/webservice/

User-added image

Notice that v2.0 in the Available Version dropdown indicates the latest (most current) version of WS API.
Notice Object Model section below.
Find HierarchicalRequirment object and click on it.

User-added image

Let's assume we want to query all user stories updated after a specific date. We set the pagesize to 200 and select to fetch full objects.

User-added image

Click "Query" button. These are the query results:

User-added image

Copy/paste the URL of the query from this window's address bar(the window where the query results are returned) to a text editor.

In this example it is:

This endpoint or variations of it can be directly pasted to the browser, or to a browser's REST client or used with curl.