Request header
x-am-response-case
- It will change the response keys text as a requested case.
NoChange response
- default, it will not change the response.
"x-am-response-case": "noChange"
CamelCase response
- Transform into a string with the separator denoted by the next word capitalized.
"x-am-response-case": "camelCase"
CapitalCase response
- Transform into a space separated string with each word capitalized.
"x-am-response-case": "capitalCase"
ConstantCase response
- Transform into an upper case string with an underscore between words.
"x-am-response-case": "constantCase"
DotCase response
- Transform into a lower case string with a period between words.
"x-am-response-case": "dotCase"
HeaderCase response
- Transform into a dash separated string of capitalized words.
"x-am-response-case": "headerCase"
NoCase response
- Transform into a lower cased string with spaces between words.
"x-am-response-case": "noCase"
ParamCase response
- Transform into a lower cased string with dashes between words.
"x-am-response-case": "paramCase"
PascalCase response
- Transform into a string of capitalized words without separators.
"x-am-response-case": "pascalCase"
PathCase response
- Transform into a lower case string with slashes between words.
"x-am-response-case": "pathCase"
SentenceCase response
- Transform into a lower case with spaces between words, then capitalize the string.
"x-am-response-case": "sentenceCase"
SnakeCase response
- Transform into a lower case string with underscores between words.
"x-am-response-case": "snakeCase"
x-am-response-object-type
- To get the flat response we use this request header.
No action
- Default, does not change response.
"x-am-response-object-type": "no_action"
{
"id": 101,
"state_id": {
"id": 201,
"country_id": {
"id": 301,
"country_name": "INDIA"
},
"state_name": "GUJARAT"
},
"city_name": "AHMEDABAD"
}
Make flat
- A deep populated response gets in the flat object. The fields are separated with an underscore(_).
"x-am-response-object-type": "make_flat"
{
"id": 101,
"state_id_id": 201,
"state_id_country_id_id": 301,
"state_id_country_id_country_name": "INDIA",
"state_id_state_name": "GUJARAT",
"city_name": "AHMEDABAD"
}
x-am-meta
- To get the meta-data of the requested API.
False
- Default does not get meta-data information in response.
"x-am-meta": "false"
True
- Provide specific information about the requested API and user.
"x-am-meta": "true"
{
"data": [
{
"id": 301,
"country_name": "INDIA"
},
{
"id": 302,
"country_name": "USA"
}
],
"meta": {
"executionTime": "15ms",
"executionPlan": [],
"apiAccessGroups": [
{
"groupId": "6381b80359bdbd3a87c9abd5",
"groupName": "all_permission",
"hasAccess": true
}
]
}
}
- executionTime - Execution time is taken by API Maker. It does not include network travel time.
- executionPlan - It will return the execution plan of MongoDb.
- apiAccessGroups - Give information about the API user group and permission.
- runBy - It will return information about the sandbox which was run the code.
x-am-secret
"x-am-secret":"6381b80359bdbd3a87c9abd5"
- Provide a secret in 'x-am-secret' and use secret values in your code.
- A secret has an encryption algorithm, and it's keys to encrypt/decrypt.
- Used in [encryption, decryption] property conversion.
- If 'nonce' is not available, 'secret' will be used for hashing.
- Do not change the value of 'secret' and do not share it with anyone or any application.
- Default hashing algorithm for generating the hash.
- Secret has an encryption algorithm for URL, query params, body, and whole request API, and it's the secret key.
- Used in [encryptData, decryptData] system API calls.
- Used to decrypt data, sent by frontend or mobile app or any client.
- secretFETransfer can be shared with FE/mobile app, so the backend can decrypt data sent by them, and they can decrypt data shared by the backend.
- Secret contains database connection strings too.
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.
- Set symbols, and special characters, as a response error message.
- Provide the internationalization name in the header, and you will get an error message in your provided language.
- No need to restart the project, just change the error message, and it will be reflected immediately.
- You can add as many as you require internationalization.
Default error response ["x-am-internationalization": "Default"]
response in Hindi language ["x-am-internationalization": "Hindi"]
response in Chinese(Simplified) language ["x-am-internationalization": "Chinese simple"]
response in Spanish language ["x-am-internationalization": "Spanish"]
response in Japanese language ["x-am-internationalization": "Japanese"]
response in Urdu language ["x-am-internationalization": "Urdu"]
x-am-run-in-sandbox
- The system will try to run requests in the maximum provided sandbox, so if 1 is provided every request will run in one sandbox only even if we have multiple sandboxes with multiple API Maker instances.
It can run in any sandbox
It can run in only one sandbox.
Run in any first 2 sandbox
Run in any first 3 sandbox
x-am-content-type-response
- We can provide a response type in the request header. As provided header value we can expect the response type.
Application/json
- Get response in json format.
"x-am-content-type-response": "application/json"
{
"success": true,
"statusCode": 200,
"data": [
{
"customer_id": 4,
"first_name": "JOHNNY",
"last_name": "LOLLOBRIGIDA"
}
]
}
Text/xml
- Get response in XML format.
"x-am-content-type-response": "text/xml"
<?xml version='1.0'?>
<root>
<success>true</success>
<statusCode>200</statusCode>
<data>
<_el>
<customer_id>4</customer_id>
<first_name>JOHNNY</first_name>
<last_name>LOLLOBRIGIDA</last_name>
</_el>
</data>
</root>
Text/yaml
- Get response in YAML format.
"x-am-content-type-response": "text/yaml"
x-am-cache-control
- It will use to reset the requested API's cache. The response will not get from the cache.
No action to cache
- It is the default value and it will do nothing.
- If caching enable then it will get a response from the cache.
"x-am-cache-control": "no_action"
You will get 'x-am-data-source:cache' in the response header if we do not reset the existing cache.
Reset cache
- It is the default value and it will do nothing.
- If caching enable or not, it will get a response from the database.
"x-am-cache-control": "reset_cache"
You will get 'x-am-data-source:api' in the response header.
x-am-get-encrypted-data
- To get response data encrypted we have to provide "x-am-get-encrypted-data" in the header.
- The encryption method is used from the default secret.
No encryption
- Nothing change in response.
"x-am-get-encrypted-data": "no_encryption"
{
"success": true,
"statusCode": 200,
"data": [
{
"customer_id": 53,
"first_name": "Deli",
"last_name": "Augustus"
}
]
}
Get only encryption
- Get only encrypted data in response.
"x-am-get-encrypted-data": "get_only_encryption"
{
"success": true,
"statusCode": 200,
"data": null,
"encryptedData": "U2FsdGVkX1+6qMdb3jXwJAUWH/qlwBq75mtA1kzpWccrNZRAr+CE2c3VtGpkEtVjH=="
}
Get data and encryption
- Get normal data and encrypted data both in a single response.
"x-am-get-encrypted-data": "get_data_and_encryption"
{
"success": true,
"statusCode": 200,
"data": [
{
"customer_id": 53,
"first_name": "Deli",
"last_name": "Augustus"
}
],
"encryptedData": "U2FsdGVkX1+6qMdb3jXwJAUWH/qlwBq75mtA1kzpWccrNZRAr+CE2c3VtGpkEtVjH=="
}
x-am-authorization
- 'x-am-authorization' contains a token of the API Maker's API user.
- The end user must have to provide x-am-authorization in every API request.
"x-am-authorization": "eyJhbGciOiJIUzI1NiIsInR1BydlRrblJlcS"
x-am-user-authorization
- "x-am-user-authorization" contains the token of the end user.
- When users log in they got them tokens.
- The API user has to provide x-am-user-authorization in every request which has access_type=TOKEN_ACCESS.
- API Maker admin can set the access type of the collection.
"x-am-user-authorization": "eyJhbGciOiJIpXVCJBydlRrblJlcS"
x-aws-authorization
- If API Maker's admin did the configuration in API Maker to take a token for AWS Cognito, the API user must pass the AWS Cognito token value in the 'x-aws-authorization' header.
"x-aws-authorization": "eyJhbGciOInR5cCI6IkpXVCJ9"
x-google-authorization
- If API Maker's admin did the configuration in API Maker to take a token for a Google user, the API user must pass the Google user token value in the 'x-google-authorization' header.
"x-google-authorization": "eyJhbGciOiJIUzI1I6IkpXVCJ9"
x-azure-authorization
- If API Maker's admin did the configuration in API Maker to take a token for Azure Active Directory, the API user must pass the Azure Active Directory token value in the 'x-azure-authorization' header.
"x-azure-authorization": "eyJhbGciOiJIUzI1NI6IkpXVCJ9"
x-no-compression
- API Maker admin can set the number of response characters in "maxCharsResToCache". Its value must be an integer number.
- If a user sends 'x-no-compression:true' then it will not compress the response.
- If the user does not send 'x-no-compression' in the request header, and the response characters are more than the value of "maxCharsResToCache" than the response will be compressed with browser default encoding methods.
- The encoding methods provide in request headers with "Accept-Encoding: gzip, deflate, br".
x-am-sandbox-timeout
"x-am-sandbox-timeout": "13000"
- The code is run in a sandbox and gives a response.
- The default sandbox timeout is 13 seconds. Users can change the sandbox timeout provided in the "x-am-sandbox-timeout" header.
- If any API did not give a response within 13 seconds, the sandbox will break and give a proper error message in the response.
- "x-am-sandbox-timeout" takes an integer number value. It has a millisecond unit.
x-am-encrypted-payload
- When the user sent an encrypted payload, the user must have to send "x-am-encrypted-payload:true".
"x-am-encrypted-payload": "true"