Version:   Beta                                                                                         Updated On:  22/Oct/2018


          UI Automation Testing is costly, mostly unstable ( because of various reasons ), time consuming and doesn’t give results as quickly as expected from stack holders. Developer will feel held up because of this. 

Other complaints are; most of the times UI automation test case failure/s doesn’t give exact root cause/s of failure/s and developer needs to spend valuable time finding out root case of bug/s.

API testing goes a level deeper than UI Automation, it is fast , stable , easy to maintain and quick yields accurate info related to a bug ( mostly ).

Lets take example of a product ordering flow of an e-commerce website. As this is most critical feature of software; it must be constantly tested in PROD , QA and Dev environments. In this scenario API testing will help more than UI testing to find out problem/s quicker and inform about it much earlier.

Mark Watney Quote from The Martian movie “At some point, everything’s gonna go south on you and you’re going to say, this is it. This is how I end. Now you can either accept that, or you can get to work. That’s all it is. You just begin. You do the math. You solve one problem and you solve the next one, and then the next. And If you solve enough problems, you get to come home.” [ so true ; in everyday’s work of Automation Engineer ]


1.  What is API

2.  Why API Testing Is Necessary

3.  What Are Different Kinds Of API

4.  API Related Common Info    

5.  Case Studies

6.  API + Cucumber

7.  Jenkins Integration ( CI Setup )

8.  Jenkins + IRC Integration

9.  Additional Info ( WIP )

10.  Tools

1. What is API ?



2.  Why API testing is necessary ?




2.4   API Testing ? Why it’s so important ( Joe Colantonio )

3.  What are different kind of API ?



4.  API Related Common Info

4.1   What is “cURL” ?

               4.1.1  Conquering Command Line ( Ch. 3 cURL )

4.2   Different Response Status Codes



4.3   Why , What , How  RESTful       



5. Case Studies :
Case Study 1:   Wunderlist  + cURL
1.  Create a new account in 

2.  Goto , click on "MY APPS"

3.  Create a new app 


XXXX4852acb2d8XXXXXX , XXXXX07fa01b277d19193162ae0381cf1e61619d160188dc2616eacXXXXX , 


curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX  -H "X-Client-ID: XXXX4852acb2d8XXXXXX" -X GET

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX" -H "X-Client-ID: XXXX4852acb2d8XXXXXX  -X GET

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX" -H "X-Client-ID: XXXX4852acb2d8XXXXXX"  -X GET

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX"  -H "X-Client-ID: XXXX4852acb2d8XXXXXX" -H "Content-Type: application/json; charset=utf-8" -X GET

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX"  -H "X-Client-ID: XXXX4852acb2d8XXXXXX" -X GET

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX" -H "X-Client-ID: XXXX4852acb2d8XXXXXX" -H "Content-Type: application/json; charset=utf-8"  -X POST -d '{"title":"new-list"}'

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX  -H "X-Client-ID: XXXX4852acb2d8XXXXXX " -H "Content-Type: application/json; charset=utf-8" -X POST -d '{"list_id":XXX0528XX, "title":"vikram-tasks"}'

curl -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX" -H "X-Client-ID: XXXX4852acb2d8XXXXXX" -H "Content-Type: application/json"  -X PATCH -d '{"revision":1,"title":"XXXXX"}'

curl -i -H "X-Access-Token: XXXXX654bc6d4aed7432b1c6d2a43598d37ab8165ce16f4b1e2e1d0XXXXX" -H "X-Client-ID: XXXX4852acb2d8XXXXXX"   -X DELETE

 File Upload - 4 API calls

 stat -f%z  KYC.png   -> gives file size in bytes

curl -i -H "X-Access-Token: dummy" -H "X-Client-ID: dummy" -H "Content-Type: application/json; charset=utf-8"  -X POST -d '{"content_type":"image/png","file_name":"KYC.png","file_size":"530145"}'

201 Created

From response body get values of "url" , "authorization" , "date" to use in below cURL call

Option 1: Works only when curl is called in same directory as file 

curl -i -H 'Authorization: AWS ...' -H 'x-amz-date: Tue, 29 Dec 2015 16:10:16 UTC +00:00' -H 'Content-Type: ' -X PUT  '' 

Option 2:

curl -i -H 'Authorization: AWS...' -H 'x-amz-date: Mon, 04 Jan 2016 14:26:19 UTC +00:00' -H 'Content-Type: ' -X PUT  ''  --upload-file "/Users/vikram-anna/Desktop/Rocky.jpg"

200 OK

curl -i -H "X-Access-Token: dummy  -H "X-Client-ID: dummy  -H "Content-Type: application/json; charset=utf-8"  -X PATCH  -d'{"state":"finished"}'

200 OK

curl -i -H "X-Access-Token: dummy  -H "X-Client-ID: dummy  -H "Content-Type: application/json; charset=utf-8"  -X POST -d '{"upload_id":45936173,"task_id":1548767307}'

 201 Created

curl -i -H "X-Access-Token: dummy"  -H "X-Client-ID: dummy " -H "Content-Type: application/json; charset=utf-8" -X POST -d '{"title":"FOLDER-API", "list_ids":[231294978]}'

201 Created 
Case Study 2:   Twitter API  + Postman
Refer to youtube video names "Using Postman for Chrome to Connect To Twitter API"


Application Settings

 1. Consumer Key      ( API Key )

 2.  Consumer Secret ( API Secret ) 

Your Access Token

 1. Access Token 

 2. Access Token Secret 
Case Study 3:   Spotify ( WIP )

3.1   Types of API requests ?


3.2   Web API Tutorial


3.3   Spotify API Console


3.4   Understanding the Spotify Web API


3.5   API References


Case Study 4 :  ( WIP )

6.  API + Cucumber

7.  Jenkins Integration ( CI Setup )
  • Once you’ve automated test cases, create job in Jenkins to run these every X minutes/hours on daily basis and send out email with detailed report of PASS/FAIL
  • This way it’s much faster to monitor prod env health with quick checks
  • Email notification can be configured to send out failure emails to PM,Dev & as QA you should receive all the emails
  • It can also be run whenever there are changes in backend code as well.
  • You can configure job as per project requirements
8.  Jenkins + IRC Integration
  1. How To Trigger Jenkins build from Slack
  2. Let Jenkins Keep You Notified ! 
9 . Additional Info ( WIP )

1. Automation & Testing REST API By Alan Richardson ( eviltester )

2. driven API testing framework )


4. Introduction To RestAssured Java REST API library for Test Automation ( EvilTester – Software Testing )

5. Java DSL for easy testing of REST services

6.   ( Demo project for reference to newcomers )

7. ( Building micro services testing framework )

8. .  ( RESTful API Testing with Rest-Assured )

9. (  How To Post A JSON Request : REST Assured )

10. (  Testing REST services with REST Assured  – Bas Dijkstra )

        ( Refer to blog conversation @ integration testing  August 10, 2016 at 10:25 am )

11. Testing RESTful Web Services Made Easy Using REST-assured framework  
( Very                 descriptive & useful explanation, multiple scenarios including Auth covered )

12.   chrome://net-internals Chrome net-internal tool to check traffic

13. ( James Willet – Technical Testing ) 

14.   Contract Testing / Consumer Driver Contract Testing with Pact

15.   Contract Tests vs Functional Tests


10. Tools

1.  Paw

2.  Postman