Wednesday, November 26, 2014

Maintaining Relations with the REST API

APIThe REST API of the ITRP service has been extended to make it possible for developers to maintain the one-to-many as well as the many-to-many links between records.

Since it has recently become possible to link multiple CIs to a request, we can use that feature to provide some examples.

The following cURL call can be used to add a configuration item to a request:

curl -u "token:x" -X POST "https://api.itrp.com/v1/requests/123456/cis/654321"

And here's how the API can be used to remove that same CI again:

curl -u "token:x" -X DELETE "https://api.itrp.com/v1/requests/123456/cis/654321"

Removing all CIs from the request is even simpler:

curl -u "token:x" -X DELETE "https://api.itrp.com/v1/requests/123456/cis"

In the above examples, token represents a user's ITRP API token. You can find your API token in the "Personal Information" section of the Settings console.

Take a look at the Change Log of the ITRP Developer documentation to look at all the possibilities that have been added.

0 comments:

Post a Comment