Auto generated schemaless GET BY ID API
[Mongo Database Only]
Simple get by id
URL
Get by any field
- Params will be given in the following examples.
- Fetch data using any field with the help of primary key.
URL
- It will return documents/rows having first_name equals "Bob"
URL
- It will return documents/rows having last_name equals "mathly"
- It will return documents/rows having pincode equals "382345"
- It will return only first_name,last_name having first_name equals "Bob"
- It will return the first record even if we have multiple rows of the same data.
Select data
- It will return only first_name and last_name of id equals "1" in response
Deep data
- It will return documents/rows from multiple table combinations.
/api/gen/user-path/instance/database/table/get-by-id/1?deep=[{s_key:'customer_id',t_col: 'products',t_key:'owner_id'}]
Here,
s_key = Source table field
t_col = Target table collection/table name
t_key = Target table field
- also use multiple query-params[skip,limit,sort,find,etc...] in single deep query.
?deep=[{s_key:'customer_id',t_col:'products',t_key:'owner_id',skip:1,isMultiple:true,limit:5,sort:'name',find:{category_id:{$in:[56572,89355]}}}]
Summary
Key | Value |
---|---|
select | ?select=first_name,customer_id |
deep | ?deep=[{s_key:'customer_id,t_col: 'products',t_key:'owner_id'}] |
Supported headers
Header | Description |
---|---|
x-am-response-case | It will change the response keys text as requested case. 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. no_action | make_flat |
x-am-meta | To get the meta-data of requested API. false | true |
x-am-secret | Place secret id from API Maker. |
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-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-content-type-response | We can provide response type in request header. As provided header value we can expect the response type. 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. no_action | reset_cache |
x-am-get-encrypted-data | Encrypt response data and get in to the response. 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-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-aws-authorization | Provide AWS Cognito token in request header 'x-aws-authorization', if required. |
x-google-authorization | Provide Google user token in request header 'x-google-authorization', if required. |
x-azure-authorization | Provide Azure active directory token in request header 'x-azure-authorization', if required. |
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-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-encrypted-payload | When user sent encrypted payload, user must have to sent "x-am-encrypted-payload:true". |