Wednesday, August 8, 2012

Testing Polycom APIs with Firefox RESTClient extension

If you want to easily test Polycom infrastructure APIs, you can use a very interesting Firefox extension: RESTClient
The Firefox REST Client addon is an excellent option when you need to quickly perform a single validation.  It is really EASY to use...

Good introduction to RESTful Web Services:

GET Method:

The basic GET operation is very simple.   It essentially is URL, Authentication, and Method.  
In my example, I would like to test the API regarding DMA-managed MCUs.

The GET method, in my case, is https://[DMA_hostname]:8443/api/rest/mcus

The "Response Body (Highlight)" section is a neatly formatted xml formed from the response body.  This may be blank if there was a failure in the request or there is no expected data to be returned, beyond the header information. That's very useful to prepare your parsing method.

POST Method:

You can also set the "Body" to use POST method, like add an user, schedule a conference...
Setting the body can be a little tricky as you need to be sure you have all the required elements, but also very useful and quicker that doing that in your final code...

You can also imagine to use CURL. CURL – “Client for URLs” – is a CLI based tool that will allow you to execute RESTful commands. A tutorial about CURL: