Skip to content

API Testing

  • Instance, custom, system, third party APIs can be tested on the 'API testing' page.
  • Events, schedulers, and data migration scripts can be tested on this page.
  • On the 'API testing' page there are left and right side panels.

Left panel

  • The left panel contains the API request-related terms like Headers, Params, Query params, Body, Code, Pre hook, Post hook, and Integrations.

Headers

  • There are Key-Value pair of the headers.
  • You can see the pre-defined headers and their values are there.
Header Description
x-am-response-case It will change the response keys text as requested case.
"x-am-response-case": "camelCase"
noChange | camelCase | capitalCase | constantCase | dotCase | headerCase | noCase | paramCase | pascalCase | pathCase | sentenceCase | snakeCase
x-am-response-object-type To get flat response we use this request header.
"x-am-response-object-type": "make_flat"
no_action | make_flat
x-am-meta To get the meta-data of requested API.
"x-am-meta": "true"
false | true
x-am-secret Place secret id from API Maker.
"x-am-secret": "6381b80359bdbd3a87c9abd5"
x-am-internationalization We can get backend error messages in any user language and directly show them to the user in UI, so the user can take appropriate actions.
Provide saved internationalization name in request header.
"x-am-internationalization": "HINDI"
x-am-run-in-sandbox System will try to run requests in maximum provided sandbox, so if 1 provided every request will run in one sandbox, even if we have multiple sandbox with multiple API Maker instances.
"x-am-run-in-sandbox": "0"
x-am-content-type-response We can provide response type in request header. As provided header value we can expect the response type.
"x-am-content-type-response": "application/json"
application/json | text/xml | text/yaml
x-am-cache-control To reset the cache of the requested API manually and get fresh data, we can use 'x-am-cache-control' request header.
"x-am-cache-control": "reset_cache"
no_action | reset_cache
x-am-get-encrypted-data Encrypt response data and get in to the response.
"x-am-get-encrypted-data": "get_data_and_encryption"
no_encryption | get_only_encryption | get_data_and_encryption
x-am-authorization Provide token of API user in "x-am-authorization" header which will be generated from API Users inside API Maker.
"x-am-authorization": "eyJhbGciOiJIUzI1NiIsdlRrblJlcS"
x-am-user-authorization User token should be provided in 'x-am-user-authorization' header which will be generated based on some database user if required.
"x-am-user-authorization": "eyJhbGciOiJIpc1BydlRrblJlcS"
x-aws-authorization Provide AWS Cognito token in request header 'x-aws-authorization', if required.
"x-aws-authorization": "eyJhbGciOiJIUc1BdlRrlJlcS"
x-google-authorization Provide Google user token in request header 'x-google-authorization', if required.
"x-google-authorization": "eyJhbGceyJpc1BdlRrlJlcS"
x-azure-authorization Provide Azure active directory token in request header 'x-azure-authorization', if required.
"x-azure-authorization": "eyJhbGciOiJIUzI1NiIJpc1BdlRrlJlcS"
x-no-compression If user do not send 'x-no-compression' in request header, and response characters are more than value of "maxCharsResToCache" than the response will be compressed.
"x-no-compression": "true"
x-am-sandbox-timeout If any API did not give a response within given time, the sandbox will break and give a proper error message in the response.
"x-am-sandbox-timeout": "13000"  // milliseconds
x-am-encrypted-payload When user sent encrypted payload, user must have to sent "x-am-encrypted-payload:true".
"x-am-encrypted-payload": "true"

Params

  • While using the Get by id, Remove by id, Replace by id, and Update by id APIs there are two params to provide.
  • Click on the 'Edit' button, and you can update params in key-value pair JSON format.
  • 'id' and 'primaryKey' should be provided while using the above APIs.
  • The 'id' is the primary key of the collection/table and 'primaryKey' is the name of the column which you want to behave as the primary key.

URL

/instance_name/database_name/collection_name/get-by-id/:id/:primaryKey

  • While using the Distinct and Distinct with query APIs you have to provide 'field' and 'order' params.
  • 'field' is the column name from which you want to get the distinct data.
  • 'order' has 'asc | desc' value.
  • If you provide 'asc' as the order value you will get the response data in ascending order of the given field and 'desc' will get response data in descending order.

URL

/instance_name/database_name/collection_name/distinct/:field/:order

Query params

  • Provide query params key-value pair as per your requirement.
  • You can edit query params in JSON format too.
Key Value
find ?find={first_name:'Bob'}
skip 2
limit 2
sort customer_id
select ?select=first_name,customer_id
deep ?deep=[{s_key:'customer_id,t_col: 'products',t_key:'owner_id'}]
getTotalCount true
All table fields You can use any column name as query params.

Body

  • In some APIs requests, it is required to provide a payload(body). You can provide payload in the 'Body' tab.
  • You can provide payload as 'JSON' or 'Form data'.
  • 'Generate data' can generate the sample payload data as a single object or array of objects.

Code

  • 'Code' tab contains your code. It can be used while using custom API, third party API, events, scheduler, and data migration script.
  • You can create multiple versions of your code. At a time only one can activate and the active version's code will use.
  • Import utility class in code to use any utilities in your custom code.
  • To get some idea about code structure you can use the 'insert code' button and add sample code.
  • From code user can call any auto-generated or external APIs.

Pre hook

  • API Maker users can add multiple pre hooks.
  • It will run before the actual API request execute.
  • You can create multiple code versions of the pre hook.
  • All APIs support pre hook.
  • Read more...

Post hook

  • API Maker users can add multiple post hooks.
  • It will run after the actual API request execute.
  • You can create multiple code versions of the post hook.
  • All APIs support post hook.
  • Read more...

Integrations

  • To call API from different languages you can generate the API code.
  • In the drop-down select the language you want and the API code will generate instantly.
  • The generated code is ready to use.

Right panel

  • The right panel contains the API response-related data. It has Response, Logs, and Docs tabs.

Response

  • The requested API response will show in the response tab.
  • You can download the response in a single click, and it can be downloaded as text file.
  • Response type, HTTP status code, taken time, etc... information is shown in this tab.

Logs

  • When you print any logs it will get in this tab.

Docs

  • If you select any code portion, you will see the related example of that code in this tab.
  • You can add that sample code to your code easily.

Instance APIs test

  • Select instance, database, collection, and API. Click on the 'SEND' button, and you will get the response of that API.
  • Test generated and schema APIs. Also, edit the collection's schema.
  • You can use headers, params, query params, body, code, pre hook, post hook, and integration for the instance APIs.
  • While testing the API you can check the detailed response on the same page.

System APIs test

  • On the 'API testing' page all the system APIs can be tested and checked their response.
  • Just select the system API, add the required details, and you can test system APIs.
  • Here, you can add pre-post-hooks in the system API.

Custom APIs test

  • Select the custom API you want to test.
  • You can see the code in the 'code' tab.
  • If you want to update the code just change the code and press ctrl + s and it will update.

Third party APIs test

  • The list of bundles, APIs version, and APIs name is shown in the drop-down.
  • Just select the API and hit the 'SEND' button to test the third party API.
  • Here, add multiple versions of the code. The active version will be executed.
  • Pre- post-hooks can be added and tested with the Third party API.

Events test

  • To test any events just select the event from the drop-down and select its listener.
  • You will the code of that event in the 'code' tab.
  • In the Body tab provides the event data if required.
  • Create multiple code versions of that listener.

Schedulers test

  • Select any scheduler from the drop-down, and you will check the code of its.
  • You can add/update schedulers, headers, and their code from this page.
  • To test the scheduler hit the 'SEND' button, and you will get the response of the scheduler code.

Database migration scripts test

  • From the drop-down select the migration script, and you can test it.
  • You can alter the code of the database migration script.
  • The response of the script will be shown in the right panel response tab.
  • If there are any logs added you will get that in the Logs tab.