🎓API Tester features

API Tester is a mobile app for iOS and Android for testing and using APIs. By using API Tester, you can send requests to connect with APIs you are working with. When you send a request, API Tester displays the response received from the API server to examine it.

API Tester has a minimalist and user-friendly interface, so you can interact with APIs on the go using only your mobile device. Cheers, you can leave your laptop at home!

This guide is an overview of all API Tester features:

Your feedback or suggestions for new features will help to improve API Tester. To submit feedback or feature requests, send an email to hello@apitester.org. Also, you can find all relevant information about the app in API Tester Updates.

Create and send request

API Tester allows creating new requests from scratch or run imported ones. Let’s try to create a simple GET request. Launch API Tester and follow these steps:

  1. Tap on the “Create new request” button - a pop-up with different methods will appear.

  2. Choose a GET method - GET request will be created.

  3. Now let's build your request. Enter a URL (representing the API endpoint you are working with). To test sending request in API Tester, you can set this URL:

    https://httpbin.org/anything
  4. Then press the blue “Play” button in the right upper corner to see what happens.

  5. All done, you have sent your first GET request and received a response!

GET methods are typically for retrieving data from an API. You can use a variety of other methods to send data to your APIs, including the following most common options:

  • POST (add new data);

  • PUT (replace existing data);

  • PATCH (update some existing data fields);

  • DELETE (delete existing data), etc.

Import collection

In some cases, the easiest way to get started with using API is to use a collection of requests. API Tester supports different types of API collections, such as: Open API / Swagger / Postman / YAML. There are 2 ways to import collection to API Tester: via link and via file. Let's do it the first way.

So, to import Collection, do the following:

  1. On the main screen of the app, tap on the “Plus” button in the right upper corner.

  2. Tap on the “Collection” button, then choose the “Link” option and input your link to the Collection. In this guide, we will use the Coingecko API requests collection (gives access to cryptocurrency price, market, and developer/social data) as an example:

    https://www.coingecko.com/api/documentations/v3/swagger.json
  3. Requests from the imported collection will appear on the main screen.

Path variables

Let’s take a look at one of the imported requests URL:

https://api.coingecko.com/api/v3/coins/{id}

API Tester app supports "/:name" and "{name}" formats of path variables. The URL of the imported request contains one path variable - {id}.

The Path Variables section is only displayed if the URL contains at least one path variable. To edit the value of path variable, fill in "dogecoin" to the "value" field:

Then send this request to examine the response. As you can see, the response contains general information about the Dogecoin such as name, symbol, platform, and description in different languages.

There is also some additional information that can be found on the response screen: in the left lower corner, there are: response code, time of receiving the response and its size.

In the right lower corner on the Response screen, there are 3 buttons:

  • “Magnifying glass” icon - to search content of the response for a specific data.

  • “Clock” icon - to see additional info of the response, such as Headers, Metrics, and the launching history.

  • “Share” icon - to share the received response.

Query params

To illustrate how to use query parameters we will run another request and get the current price of a Dogecoin expressed in USD:

  1. Search for a word “Price” on the main screen of the app to see relevant requests included in this Collection. Select “Get the current price of any cryptocurrencies in any other supported currencies that you need”.

  2. Specify values of query parameters. Query parameters are optional key-value pairs that appear to the right of the “?” in a URL. You can specify them directly in the URL by editing it. Alternatively, there is a more user-friendly way of adding values for Query Params in a special section (check the screenshot below). Here are the key-value pairs for getting Dogecoin to USD price: ids=dogecoin vs_currencies=usd

  3. Send the constructed request that should look like this:

    https://api.coingecko.com/api/v3/simple/price?ids=dogecoin&vs_currencies=usd
  4. Response with the price of Dogecoin is received.

Duplicate request

Let’s try to get the current price of a Bitcoin expressed in USD with the request we used above by duplicating it and replacing the query parameters:

  1. Go back to the main screen of the app and swipe the request to the left. The following three icons will appear near the request: share link, duplicate request, delete request.

  2. Tap on the duplicate icon. After this step, you will be redirected to the duplicated request.

  3. Change Query Params by switching Dogecoin for Bitcoin. It will look like this: ids=bitcoin vs_currencies=usd

  4. Response with the price of Bitcoin is received.

Share request

What if you would like to share this request or save it for your future work? This is easy to do:

  1. Go back to the main screen in the app, swipe the request you want to share to the left, select «Share» icon.

  2. In the pop-up window you can choose any option for sharing, e.g., share request via message, mail, or copy link. Let’s try the last option. The link for this request will look like this, tap on it to check how it works:

Authorization

There are certain types of request which require authentication of users to get a response. In API Tester you can choose one of three authorization options in the Auth section: none, basic, OAuth. Next, we will review examples of all options.

Basic authentication implies adding the username and password of a person who wants to make a request to the specific server. In API Tester app, you can do this by following these steps:

  1. Create new request.

  2. Add the following endpoint into the URL field:

    https://httpbin.org/basic-auth/John Doe/qwerty
  3. Fill in the authorization data into the Basic tab in the Auth section:

    Username=John Doe
    Password=qwerty
  4. Run the request.

In the OAuth tab you need to place the value for the access token, also you will have the ability to add this value to the query. By default, the value for access token is not added to the query, so it's optional. To run the request with OAuth, you will need to:

  1. Create new request.

  2. Add the following endpoint into the URL field:

    https://httpbin.org/bearer
  3. Put the value "your_token" in the Access Token field in OAuth tab of Auth section.

  4. Run the request.

Also, you can get access keys or tokens either by making a specific authorization request or from the API source (an example of the second option is described in Google APIs Guide). Here, we'll describe how to get an access token with a request.

  1. Create a POST request and add the following endpoint:

    https://restful-booker.herokuapp.com/auth
  2. Put this piece of a code into the Post data tab:

    {
     "username": "admin",
     "password": "password123"
    }
  3. Choose value "application/json" for the "Content Type" in a Raw tab of body section.

  4. Run the request.

All done! Now you can copy the token from response and use it for the request from the next section!

Body params

Several request methods contain tabs where user need to place a piece of code with arguments and specific data for running a correct request - this section is called Body. In API Tester app there are 4 different data options for adding specific information for the request:

  1. URLEncoded;

  2. FormData;

  3. Raw;

  4. Binary.

You can either upload a file with a piece of code, place it as a key-value pair or put a code in a special field.

Let's review the adding a raw data. We'll use the POST request for creating a booking with the access token from the previous section:

  1. Create new POST request and place this endpoint:

    https://restful-booker.herokuapp.com/booking
  2. Place this piece of code in a Post data tab:

    {
        "firstname" : "Jim",
        "lastname" : "Brown",
        "totalprice" : 111,
        "depositpaid" : true,
        "bookingdates" : {
            "checkin" : "2018-01-01",
            "checkout" : "2019-01-01"
        },
        "additionalneeds" : "Breakfast"
    }
  3. Choose value "application/json" for the "Content Type" Raw tab of body section.

  4. Put an access token in a OAuth section.

  5. Run the request.

As you can see in the response, we got the ID of the created booking and information we've uploaded.

To run the request with FormData Body parameters you will need to:

  1. Create a new PATCH request.

  2. Add the following endpoint in the URL field:

    https://httpbin.org/patch 
  3. Fill in the FormData section in Body Params tab in a form of key-value pairs: foo=bar baz=xyz

  4. As a Header, set "multipart/form-data" for "Content-Type" and run the request.

Creation of a request with URLEncoded Body params consists of few simple steps:

  1. Create a new PUT request by tapping Create new request button on the main screen, or by tapping on a Plus button in the right upper corner.

  2. Add the following endpoint in the URL field:

    https://httpbin.org/put
  3. Fill in the URLEncoded section in Body Params tab in a form of key-value pairs: foo=bar baz=xyz arr=1 arr=2

  4. As a Header, set "application/x-www-form-urlencoded" for "Content-Type" and run the request.

You can also add Binary data to your requests, to do so:

  1. Create a new POST request.

  2. Add the following request endpoint:

    https://httpbin.org/post
  3. In the Binary tab of the Body section of request add any file you need, it could be photo, video, audio, or text file.

  4. Set request Header Content-Type with value application/octet-stream and run the request.

In most of the cases Content-Type header will be added automatically depending on the data you place in the request Body, but in other cases you can always add any custom header you need manually.

Request headers

Headers are an important part of each request. Compared to parameters, headers provide information about technical components of the request or response. You can find headers either on the request main screen or on the response screen ("Clock" icon).

Some headers are added automatically when importing a request, others - need to be put manually by user. You can find headers and their values in the Headers section of request. For user's convenience, there are special hints which help you to place necessary headers. You can find them by tapping on the Add Header button.

In cases, when Headers were imported with request, you can easily manage them by tapping on "Edit" button. The special screen will open where you can place any other headers or delete existing ones.

Request cookies

API Tester app allows its users to use cookies for any requests. There is a special section in most types of request, where you can set up your cookies. To add cookies, you need to:

  1. Open chosen request in API Tester app;

  2. Switch the "Enable to send & accept cookies" button;

  3. Tap "Add Cookie";

  4. Fill in compulsory fields "Name" and "Value", and other fields if necessary;

  5. Tap "Add" button.

All done! You've created your personal cookie!

To edit cookie, you need to tap on the created cookie and then tap the "edit" button in a right upper corner. If you want to delete a cookie, just swipe it to the left and the delete button will appear.

Request settings

In each request, there is a Settings tab, you can find it by tapping on the button with three dots. In the pop-up menu, you will find the following options:

  1. Rename (gives you an ability to change request name);

  2. Settings;

  3. Export cURL;

  4. Share link.

The second function contains additional settings for a request, such as: Timeout (Seconds), Follow Redirects, and Verify SSL. The last two options can be disabled by switching the button. All these settings allow users to set up requests according to their needs and preferences.

Clear history of requests

In some cases, you may need to delete all requests from the app (for example, to clear your requests list or to import new ones). To do that:

  1. Go to the main screen and tap the “3 dots” icon in the left upper corner.

  2. There are several useful options, you can: - share API Tester app, - join API Tester Community in Telegram, - reach out to our support team via email, - or delete all requests.

  3. Tap “Delete all requests”. As you can see, all requests were successfully deleted from the main screen.

GraphQL

To create and run GraphQL request in API Tester, you need:

  1. Tap ‘Create new request’ button and choose GraphQL.

  2. Place a GraphQL endpoint into the URL field:

    https://graphqlpokemon.favware.tech/
  3. Put the following piece of code into the body tab:

    fragment data on Pokemon {
      num
      species
      types
      abilities { first second hidden }
      baseStats { hp attack defense specialattack specialdefense speed }
      gender { male female }
      height
      weight
      flavorTexts { game flavor }
      evYields { hp attack defense specialattack specialdefense speed }
      isEggObtainable
      minimumHatchTime
      maximumHatchTime
      levellingRate
      sprite
      shinySprite
      backSprite
      shinyBackSprite
      smogonTier
      smogonPage
      serebiiPage
      bulbapediaPage
    }
    
    query($pokemon: PokemonEnum! $reverse: Boolean! $take: Int!) {
     getPokemon(pokemon: $pokemon reverseFlavorTexts: $reverse takeFlavorTexts: $take) {
      ...data
     }
    }
  4. Add variables to the request, by putting the piece of code presented below:

    {
     "pokemon": "arceus",
     "reverse": true,
     "take": 1
    }

When all request elements are set, you can run the request and study the response.

After receiving the response, you can study documentation provided for this API. You can find it in docs tab. In the docs tab, all possible queries for request are listed with details and description.

Also, you can find the Settings tab in GraphQL request, where you can add Headers, Cookies, or authentication data if required.

Note that all GraphQL requests in API have the same endpoint. To get the information, you need it is required to construct a correct body and, if necessary, to add GraphQL variables.

Websocket

API Tester supports the exchange of data between the server and user through WS and WSS connections. To create a Websocket request, you need to follow these steps:

  1. Tap the Plus button on the main screen of the app and choose Websocket.

  2. Put this endpoint into the URL field:

    wss://ws.postman-echo.com/raw/
  3. Tap the "Connect" button to create a connection with this server.

4. On the response screen put any text in the message field, for example: Hello and tap Send button you will receive the response message from server.

To close the connection, you can press Disconnect button in the right upper corner of the response screen, or it will be disconnected automatically in a certain period of time (depends on the server you work with).

As well as in other request types, you can add Query params, Headers and authentication data for request if required in the Websocket request screen.

There are two ways of how to search for specific information in any response. First, is a key-word search, second - JSON Path filtering.

As an example, we’ll take the following GET request:

https://trello.com/1/emoji

You need to:

  1. run this request and open the response screen,

  2. there you will find Magnifying glass icon, tap it and a special field for search will appear,

  3. type in the search field any word you are looking for, e.g., word "smile".

  4. observe all mentions of a word "smile" with their quantity in the response (search results will be marked with yellow color).

To make a JSON Path filtering in response, you need to correctly specify the information you look for. In this type of search, you should start with $. combination and then specify the concrete information for search. This might look like this:

$.trello[2].name

After putting this combination in the search field, you will get the result "Face with tears of joy". You can check whether this search was correct or not by tapping of cancel button in the right upper corner and checking the whole response.

Import from WebProxyTool

WebProxyTool offers an opportunity to detect all outgoing HTTP(S) traffic from other apps and import it in a form of requests to API Tester. To do so, you will need to follow a few easy steps:

  1. Open WebProxyTool and switch "Record HTTPS traffic" button.

  2. Open any app you want to get requests from.

  3. Go back to WebProxyTool and choose the request you need to import.

  4. In a request screen in WebProxyTool open "Test" tab, then tap "Import to API Tester" button, and you will be redirected to the API Tester app.

After these steps, the request screen will be opened in API Tester where all data from WebProxyTool request will appear, and you will be able to run the chosen request.

SOAP requests

API Tester supports sending requests to SOAP APIs as well as to REST APIs. To send a SOAP request, you will need to:

  1. Tap Create new request button or Plus button in the right upper corner and choose POST method.

  2. Add the following endpoint:

    http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso 
  3. Place this piece of code into the Post Data tab:

    <?xml version="1.0" encoding="utf-8"?>
    <soap12:Envelope xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
      <soap12:Body>
        <ListOfContinentsByName xmlns="http://www.oorsprong.org/websamples.countryinfo">
        </ListOfContinentsByName>
      </soap12:Body>
    </soap12:Envelope>

Also, it is required to set the value for Content Type as text/xml In Body section of the request and when all parameters are specified, we can run the request. In the response of this request, you will get the list of all world continents.

JSON-RPC requests

For this type of request, the user will need to use only one endpoint and change code in Post data for specifying the information you are looking for. Let’s create JSON-RPC request:

  1. Create new request and choose POST method.

  2. Add the following endpoint into the URL field:

    https://api.mainnet-beta.solana.com
  3. Place the following piece of code into the Post data section of the Body Tab:

    {
     "jsonrpc": "2.0",
     "id": 1,
     "method": "getHealth"
    }
  4. Set the value for "Content-Type" header in the Headers section as "application/json" and run the request.

As an example, we used JSON-RPS API of Solana and by running the request above you can check the current health of the node.

XML Requests

With API Tester, you can send XML requests as well. To create an XML request, do the following:

  1. Tap "Create new request" button or "Plus" button in the right upper corner and choose GET method.

  2. Add the following endpoint into the URL field:

    https://boardgamegeek.com/xmlapi/boardgame/35424
  3. Add header "Content-Type" in Headers section and specify "text/xml" value.

  4. Run the request.

In this example as a response you will receive data about concrete board game with details and description in the XML format.

In most cases, when submitting XML calls through the API, make sure that the Content-Type is set to "text/xml".

Apple Watch

For owners of the Apple Watch, it is possible to work with API Tester using this device. It could be very convenient when you have a handy instrument to work fast with your current requests. Using API Tester with Apple Watch, you can:

  1. Get quick access to the requests list.

  2. Run any request without using mobile phone.

  3. Have access to the app even if you are far away from phone or any other device.

Integration with Apple Watch offers an opportunity to perform different actions with APIs without using any other devices. This is especially helpful in cases when you want to do a quick action or command.

Widgets

IOS platform supports very helpful feature named Widgets, which offers an opportunity to personalize your mobile device and make it more convenient for users. To work faster with your current requests, it is now possible to add API Tester widgets on the home screen and get quick access to the app. To do so:

  1. Open the home screen on your mobile device, touch and hold the empty area until your apps jingle.

  2. In the top left-hand corner of the screen you will see the Plus button, touch it and the widget menu will appear.

  3. Find API Tester app manually in the list of apps, or search for it using the search field.

  4. Choose from the three available widget sizes and set the requests you want to see on the widget.

  5. Tap Add Widget, then tap Done.

And that’s it! Now you have access to the most relevant requests of your collection. This is extremely helpful because you will have any requests from the API tester on your main screen. And to open it you will just need to tap on the request in the Widget, and it will be automatically opened in the app.

Shortcuts

Another one great feature which allows getting quick access to the API tester app on IOS platform is Shortcuts. This is a great tool which makes running requests in API Tester even easier. To use Shortcuts for API tester, you will need to:

  1. Install Shortcuts app on your device.

  2. Open the app on My Shortcuts screen and tap on the Plus button in the right upper corner.

  3. Use "Search for apps and actions" button to search for API Tester and select the action.

  4. Name your Shortcut and add the settings you need (select the exact request or requests you want to run, date and time when the request should be run, add special conditions for running the request, etc.).

The Shortcuts offer a lot of different useful settings for actions: you can add API Tester Shortcuts to the home screen as well as enabling showing them on your Apple Watch. By creating Shortcuts for the API Tester app, you will be able to automatize your work with different requests.

Run all requests

API Tester supports the function which allows running all requests on your app in one tap. To do so:

  1. Add different set or collection of requests to API Tester.

  2. On the main screen of the app, tap the icon with three dots in the right upper corner.

  3. In the popped up menu, choose option "Run all requests".

Near each request you will see the data about request launch which contains: response code, time, and size. Also, for those requests where path parameters are required, but the value is missing, you will see the note "missing params".

Global Variables

For running requests with common parameters, there is a special function named Global Variables available. It allows using key-value pair for parameters which can be used in requests from one collection or in requests from common API. To set the number of Global Variables, you will need to:

  1. Import or create requests you want to run.

  2. On the main screen of the app and tap the button with three dots in the right upper corner.

  3. Tap "Global Variables" button and the pop-up window will open.

4. Set necessary parameters as a key-value pairs, where "key" is a code word for a parameter’s value, and "value" is a meaning for this parameter.

5. Open request you want to run and place the variable key in double curly braces in the desired value field.

6. Run the request.

You can manage your Global Variables by adding new ones using the "Add Variable" button, or deleting existing ones by swiping any parameter to the left.

This function is extremely convenient in cases when you work on multiple requests or when you need to run all requests simultaneously by using "Run all requests" function.

You can use Global Variables in URL, query and body params, headers and auth to reference different variables.

Last updated