trOnGAtE

Testing Your API Endpoints
Trongate makes it easy for you to test your API endpoints by including an API Explorer page. The URL for opening the API Explorer is your base URL followed by:
api/explorer/module
For your app, replace 'module' with the name of the module directory where your api.json settings are to be applied.

http://localhost/autoshop/api/explorer/cars
How To Test A Particular Endpoint
On your opening API Explorer page, you'll see rows, representing each of your endpoints. Towards the left hand side of each row, you'll see a coloured button with the name of the request type on the button. For example, 'GET'. Clicking on one of those buttons, opens up a pop-up window:

Understanding The Pop-Up Windows
The pop-up windows, on the API Explorer, contains information and features that can help you to understand how your endpoint works. From here, we can also submit HTTP requests and test our endpoints.

Included here, we have:
- The endpoint name
- A textarea for submitting optional parameters
- An area on the right-hand side displaying the response from the server
- A checkbox, giving you the option of bypassing authorization tests
- A checkbox for clearing the parameters textarea
- A check for displaying response header values
- A button for copying the server response body
- A button for viewing the settings for your API endpoint
- A submit button for sending requests to your API endpoint
Additional Information
Towards the bottom left-hand side of each pop-up window, you'll see a summary of some other important information, relating to your endpoint. Specifically,
- URL Segments - the URL segments that must be added to your base URL in order to invoke the endpoint.
- Required HTTP Request Type - the type of HTTP request that the endpoint has been designed to receive. For example, 'POST'
- Endpoint Settings - the location of the file where the settings for the endpoint have been declared
- Your Current Token - your current security token (refer to How Trongate's Token System Works for details)
Understanding Server Responses
When you submit an HTTP request, using the API Explorer, you'll see - near the top right-hand side of the pop-up window) an indication of the HTTP Response Code that has been issued by the server, along with an indication of the text (sometimes called 'the HTTP response body') that has been produced by the endpoint.

Setting Tokens
On the top right-side of the main API Explorer page, you'll see a facility that allows you to set a Trongate security token for testing.
HELP & SUPPORT
If you have a question or a comment relating to anything you've see here, please goto the Help Bar.