# Using REST client for testing

To check if your installation of MifosX instance is working properly or not or for the changes you made, you can use a REST client for testing the installation/change properly.\
\
Here in this guide, we would be using one of the famous REST client **Postman** but you need not to necessarily use it, any REST client would do.\
\
We will be assuming few things beforehand:

```
URL: https://localhost/fineract-provider/api/v1/
Username: mifos
Password: password
Tenant ID: default
```

{% hint style="info" %}
Note: You will get this configuration if you have followed all the steps given the MifosX installation guide, this is default configuration for the server.
{% endhint %}

### Steps

* Open up the Postman and you will see something like this:

![Empty Postman](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6reUGAvhmcJuuysNmE%2F-M6rgZj4ddrJF9rCbfSP%2Fpostman.png?alt=media\&token=ab9a1f27-3e14-42d6-b8dc-414268f8cb94)

* Enter URL: <https://localhost/fineract-provider/api/v1/offices\\>
  Request type would be GET (which is default).
* In Authorization tab, select 'Basic Auth' and fill up username as *mifos* and *password* (default credentials).

![Authorization Tab](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6s5-C9YGVEmQx2BhAw%2F-M6s6XfNwaQarwyxaG7F%2F2020-05-07.png?alt=media\&token=409b8ce8-fbd8-4f2f-8c00-47572ba3e42a)

* Next up, we will edit Headers Tab.\
  Fill 'Accept' in key section for the first header and 'application/json' in value section.\
  Fill 'Fineract-Platform-TenantId' in key section for the second header and 'default' in value section. ('default' is default TenantId for a MifosX instance)

![Header Tab](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6s5-C9YGVEmQx2BhAw%2F-M6s7esZOp1z3lvrh5ak%2F2020-05-07.png?alt=media\&token=7c933249-dc28-4930-93b6-9984a4edc8b6)

* We're done, now just click on the 'Request' Button given near the URL text box. And voila!\
  If your instance is running correctly, you would see Response Code as 200 and a valid json response.\
  Here is sample response:

![Sample Response](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6s8tNtoSuXrc6sf0i3%2F-M6sNGRFaeFVS1nxXwBX%2F2020-05-08.png?alt=media\&token=4cce2258-cd2c-4347-9322-927f2ccd51dd)

### Steps for a POST request

You may also want to do a POST request and couldn't figure how to do it properly.

* We'll keep headers and authorization tabs intact as they were in GET request above.
* We'll select POST from the dropdown near URL text box and change the URL to <https://localhost/fineract-provider/api/v1/staff>.

![It should look something like this](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6sQTNNpwdIRNRfDWwo%2F-M6sQZ5THdu-TSW21Tqn%2F2020-05-09.png?alt=media\&token=44d770f2-0a47-49a8-a92b-3b13d4f8cc6e)

* Now, go to 'Body' tab and fill up with this sample request.

```
{
   "isLoanOfficer":true,
   "officeId":1,
   "firstname":"bharath",
   "lastname":"c",
   "joiningDate":"02 March 2020",
   "locale":"en",
   "dateFormat":"dd MMMM yyyy"
}
```

![Body for the POST request](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6sQpmB2DdxNJzAnlTh%2F-M6sUS82mF1DXZmIKR_P%2F2020-05-09.png?alt=media\&token=b8900883-d909-49de-b3b3-a43187c841e7)

* Click on Send Button and done! If everything is fine, then you will see a response similar to this:

![Sample Response for the POST Request](https://2235457518-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lb-oDYAENt-r5hW1bjo%2F-M6sQpmB2DdxNJzAnlTh%2F-M6sYX8LjlC1VnDJCyD4%2F2020-05-09%20\(1\).png?alt=media\&token=c7696729-2d82-425b-95ed-ab612ec63aed)

{% hint style="info" %}
In case you want to test other API endpoints, checkout API docs [here](https://demo.mifos.io/api-docs/apiLive.htm).
{% endhint %}
