Trongate Docs
switch to dark modeswitch to dark mode
»
»
Building Your Api Settings File

Required API Endpoint Parameters

The File Opening

Your api.json file is going to contain instructions for creating an object, using JSON. In JSON, an object can be declared with curly brackets.

{}

Required Parameters

Each API endpoint will require a variety of parameters to work.  The required parameters are:

  • The Endpoint Name: This is a word in double quotations that will be your declaration of the endpoint name.  Below is an example of an api.json file with an endpoint name of "Get Records" being declared:

{
    "Get Records": {}
}

  • request_type: The request_type is a declaration of the type of HTTP requests that your API endpoint is going to accept.  Possible values are; "GET", "POST", "PUT" and "DELETE".
  • description:  The description parameter should be a short sentence indicating what the endpoint does.  For example, "Fetch rows from table".
  • enableParams: This is a declaration as to whether optional custom parameters will be accepted by the API endpoint.  Possible values for this are true and false.
  • authorization: The authorization parameter is a declaration of what authorization rules should be applied to the API endpoint.  How authorization works, for API endpoints, will be covered in more detail later on.  In the meantime, it's enough to know that "*" is a declaration that the API endpoint is open to anyone.

WARNING!
All of Trongate's in-built API endpoints require authorization rules.  If an in-built API endpoint does not have authorization rules then the endpoint will be disabled.  However, custom endpoints (which will be covered later on) can potentially function with or without using Trongate's in-built token authorization system.

Example

The screenshot below shows an API endpoint called 'Get Records' being declared.  This endpoint will receive HTTP get requests.  

screenshot


HELP & SUPPORT

If you have a question or a comment relating to anything you've see here, please goto the Help Bar.

 
×