How to Test APIs on Mobile using API Tester
Tags: testing, api, mobile, webdev
Published: 2022-11-29 20:24:29

Imagine testing APIs using your mobile device, either iPhone or Android. All APIs, including REST, GraphQL, WebSocket, SOAP, JSON RPC, XML, HTTP and HTTPS.

This article will show how we can test APIs on mobile devices using [API TESTER.](https://apitester.org/)

![API Tester Application](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669160776325_image.png)


Prerequisites


1. API TESTER Mobile Application
2. Ready to Use API endpoints

The API TESTER application is freely available for the following devices:


- iOS: [Download Link](https://apps.apple.com/us/app/api-tester-debug-requests/id1575521212)
- Android: [Download Link](https://play.google.com/store/apps/details?id=apitester.org)
- Huawei: [Download Link](https://appgallery.huawei.com/app/C107072573)

This article will use demo API endpoints from JSONPlaceholder, which offers free fake REST API.

https://jsonplaceholder.typicode.com/

We will use two endpoints:

    https://jsonplaceholder.typicode.com/posts
    https://jsonplaceholder.typicode.com/todos

On a mobile device, open up the API Tester application:


![Openning the API Tester Application](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669237388423_file.png)


To get started, click on the `Create new request` 

The next screen provides various options, from selecting the type of request, GET, POST, PUT, PATCH, DELETE, to importing APIs from external platforms like Postman.


![create a new get request](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669239919448_image10.png)

## GET Request

Create a new `GET` request by tapping on the GET button:


![get reqest](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669239958526_image9.png)


Give the request a name and paste in any of the API endpoints:


    https://jsonplaceholder.typicode.com/posts
    https://jsonplaceholder.typicode.com/todos

**Getting All Todos:**

Paste in the endpoint: `https://jsonplaceholder.typicode.com/todos` and tap the blue play button on the top right.
****

![results](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669240286256_image4.png)


The response:

![response](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669240384497_image3.png)


When testing APIs, we usually test for all Request methods. Next, we’ll look at how to test for Sending a POST request.


## POST Request

To send a post request from API Tester mobile application, go to create a new request (+ icon) and select a `POST`. We will use the same endpoint as `GET` request:

`https://jsonplaceholder.typicode.com/todos`

To make a POST request, we will need to add a few options:

The first step is to update the `Body` of the request. We will post data in JSON format, so tap on the Raw tab under the body section. 

Ensure the **Content-Type** is set to **application/json.**

![content type](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669638977127_IMG_3926.png)


The next step is to update the headers:


    Content-Type application/json; charset=UTF-8


![json](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669638849493_IMG_3925.png)


To add the data to send, we head up to the **Body** section under the Raw tab and tap on post data

![alt](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669639221569_IMG_3926+1.png)


Paste in the JSON data:


    {
    "userId": 1,
    "title": "a big one",
    "body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
    }
    
![data format](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669639280294_IMG_3929.png)


Once that is done, tap on the blue play button on the top right of the application.
If everything is properly done, the app returns a response with status code 201 (Created), and a new id created with the new object posted


![gig](/static/img/pixel.gif)

![aha](https://paper-attachments.dropboxusercontent.com/s_435E77D4839266934A06FAE2824FEB32CD7E7BC76FAD878447FEC5C1D56BE056_1669639588255_IMG_3930.png)



## Conclusion

This article has explained the processes of using the API Tester mobile applications to test for APIs using `GET` and `POST` methods using a free test API endpoint.


## Resources

[API Tester Guides](https://docs.apitester.org/)