Error messages reference¶
Each message of API Maker has a code, like AM_00001. The code helps you find the cause fast. You can also translate any message for your users with internationalization.
In short
- A message is a template :
{field},{value}… are filled from the request. - The answer holds the message only, not its code. Look the text up on this page.
- Most of these messages come with
400. The access messages come with401or403.
An answer with AM_00002
{
"success": false,
"statusCode": 400,
"errors": [ { "type": "min", "field": "price_cents", "message": "Please provide minimum '0' for 'price_cents' field.", "code": 400 } ]
}
Data and schema¶
The schema of the table refused a value.
| Code | Message | When |
|---|---|---|
| AM_00001 | Please provide valid '{field}' field with type '{type}'. | A required field is missing or empty, in a new row. |
| AM_00002 | Please provide minimum '{value}' for '{field}' field. | validations.min |
| AM_00003 | Please provide maximum '{value}' for '{field}' field. | validations.max |
| AM_00004 | Property '{field}' should have minimum length of '{value}'. | validations.minLength |
| AM_00005 | Property '{field}' should have maximum length of '{value}'. | validations.maxLength |
| AM_00006 | Please provide unique value '{value}' for key '{field}' in data index '{dataIndex}'. | validations.unique : the value is already in the table, or twice in the rows you send. |
| AM_00007, AM_00008 | Please provide unique combination for keys ['{validationPath}'] in data index '{dataIndex}'. | A unique combination of columns, already there or twice in the rows you send. |
| AM_00010 | {field} should be array in schema as data is in array. | A list sent for a column that holds one value. |
| AM_00011 | '{value}' is not a valid number for key '{field}'. | A value that can not become the number the schema asks for. |
| AM_00015 | Invalid date in '{field}' field. | A value that can not become a date. |
| AM_00017, AM_00018, AM_00019 | Can not convert object / array to objectId in '{field}' field. Invalid objectId in '{field}' field. | A value that can not become an ObjectId. |
| AM_00021, AM_00022 | Invalid date in min / max field in schema validation for '{field}' field. | The schema itself has a bad min or max date. |
| AM_00058 | Found empty schema to validate. | The schema of the table has no columns. |
| AM_00061 | Invalid data found for saving. Please provide data in JSON object format to save. | The body of a save is not an object or a list of objects. |
| AM_00062 | Type of '{field}' should be array in schema. | Array operations on a column that is not a list in the schema. |
| AM_00087 | Please provide valid value in {field}. | A validatorFun returned false. |
| AM_00101 | {message} | The text your code threw : a validatorFun, a conversionFun… |
| AM_00111 | Property '{field}' should be valid email address. | validations.email |
| AM_00114 | [{field}] is duplicate having value [{value}]. | A unique index of the database refused the row. |
| AM_00116 | Property '{field}' should have any value from {value}. | validations.enum |
| AM_00117 | Concurrency version mismatch in '{field}'. This row/document is already updated. | The version you sent is old, or missing : someone saved the row since. See optimistic concurrency control. |
Queries¶
A find, a select, an id or a body that API Maker can not use.
| Code | Message | When |
|---|---|---|
| AM_00009, AM_00020 | {field} should be array as it is logical operator. | $and, $or or $nor with something that is not a list. |
| AM_00012 | Please provide id param value | Get by id, update by id or remove by id, without an id. |
| AM_00013, AM_00014 | Invalid value in '{field}' field, expected number… / Invalid number in '{field}' field. | A find value that can not become the number of the column. |
| AM_00023, AM_00024 | Array is expected in key '{field}'. / … and it's length is zero. | An operator like $in without a list, or with an empty one where a value is needed. |
| AM_00044 | Please provide array for aggregate body. | The aggregate API needs a pipeline : a list. |
| AM_00045, AM_00047 | Please provide field for distinct API. You can also provide multiple fields separated by comma. | Distinct without a column. |
| AM_00046, AM_00048 | Invalid column ['{field}'] found in your field list. | Distinct with a column the schema does not have. |
| AM_00049 | Please provide 'find' property having query to remove data. | Remove by query without a find. Nothing is ever deleted without a filter. |
| AM_00051 | Primary key '{field}' not found in schema. | The primaryKey part of the URL names a column the schema does not have. |
| AM_00052, AM_00053 | Unable to convert '{value}' to number / objectId based on your schema type. | An id that does not fit the type of the key. |
| AM_00054, AM_00055 | Invalid primary key type '{type}' found for '{field}'. / Primary key not found in … | The table has no primary key API Maker can use. |
| AM_00056 | Schema is not defined for this collection '{collectionName}'. You can define schema or please try /api/gen version of the api. | A schema API on a table without a schema. |
| AM_00060 | find property should be string of valid JSON/JSON5. | A find query param that does not parse. |
| AM_00065 | Unsupported value found for parameter '{field}' | SQL Server got a value of a kind it has no type for. |
| AM_00097 | Please provide 'path' property. | An item of array operations without its path. |
| AM_00098 | Please provide request body. | A write without a body. |
| AM_00112 | Please provide valid value in '{field}'. It should be array in schema. | A find value for a list column that is not a list. |
| AM_00119 | Record not found. | throwErrorIfRecordNotFound=true and no row has the id : 404. |
| AM_00042, AM_00095 | This API is only supported for mongodb. / Replace by id API is not supported for instance type '{type}'. | Aggregate, array operations or replace by id on an SQL table. |
Deep and find and join¶
deep and find and join could not reach the related table.
| Code | Message | When |
|---|---|---|
| AM_00036 | Please provide t_col value. | A find and join on a column whose schema names no related table. |
| AM_00037 | Unable to find collection for s_key:'{field}', You can provide it in schema or deep by 't_col' property. | A deep item without t_col, and no relation in the schema for its s_key. |
| AM_00039 | Unable to find collection with name '{collectionName}' on path '{instanceName} -> {databaseName} -> {collectionName}'. | The related table does not exist. |
| AM_00040 | Unable to find primary key for target collection '{collectionName}'… | The related table has no primary key, and the item has no t_key. |
| AM_00063, AM_00066, AM_00067 | Unable to find schema … / Unable to find property '{field}' in schema of … | The related table, or its column, has no schema. |
| AM_00085 | $in/$nin operator value must be non empty array. | A find and join with $in or $nin on something that is not a list. |
| AM_00086 | $gt/$gte/$lt/$lte value should be valid [string, number, date (iso format)]. | A find and join that compares with something that is not a text, a number or a date. |
| AM_00118 | Virtual field can not be used in find join feature. '{field}' is virtual field. | A find and join on a virtual field. |
Tokens and access¶
Who calls, and what they may do. See Secure your APIs.
| Code | Message | When |
|---|---|---|
| AM_00035 | Authorization header 'x-am-authorization' is not valid. | No token of an API user, or a token that does not verify : 401. |
| AM_00084 | Invalid access token. | A token of an API user made before its password changed, or of another account : 401. |
| AM_00034 | User '{name}' with username '{username}' is not having access to this API '{url}'. | A good token, but no group of the API user allows this API : 403. |
| AM_00050 | User '{name}' does not have access to fields [{field}]. | The groups of the API user do not allow these columns. |
| AM_00113 | You are not authorized to access this API. | The API is closed to callers from outside (NO_ACCESS) : 401. |
| AM_00032 | Invalid request origin. You can give access to this host '{origin}' from settings. | A token that the admin panel made for API Testing, used outside the admin panel. |
| AM_00090 | Please provide token request with ['u', 'p'] or ['refresh_token']. | The body of the token API lacks the username and password. |
| AM_00092 | Please provide '{name}' token in request headers. | The API asks for the token of a person, and the header is missing. |
| AM_00093 | Invalid token provided in '{name}' header. | The token of a person does not verify. |
| AM_00094 | Token user not found in '{instanceName}' -> '{databaseName}' -> '{collectionName}'. | The person of the token is no longer in the users table. |
| AM_00105 | Multiple entries exists for this username '{value}' in database collection|table. | The users table has the username twice. |
| AM_00109 | Access groups not assigned to user. | The person has no group in the groups column. |
| AM_00115 | Invalid JWT token provided. | A token of a person, made before the password of that person changed. |
Secrets and encryption¶
The default secret lacks a key, or an encrypted body is not right.
| Code | Message | When |
|---|---|---|
| AM_00025 | A default secret is required because of encryption used in key '{field}'. | A column with encryption or hashing, and the account has no active default secret. |
| AM_00026 | Unable to find valid algorithm named '{algorithm}' for '{field}' field. These are valid encryption algorithms ['AES', 'RC4', 'TRIPLEDES']. | The secret names an algorithm API Maker does not have. |
| AM_00027, AM_00029 | Unable to find encryption algorithm / secret for '{field}' field… | The default secret lacks common.encryptionAlgorithm or common.secret. |
| AM_00028, AM_00030 | Unable to find hashing algorithm / nonce for '{field}' field… | The default secret lacks the keys of hashing. |
| AM_00059 | Default secret is not present in the system. | Get secret, and the account has no active default secret. |
| AM_00103 | Unable to decrypt data of 'dataEncFE' field. | The body does not decrypt with the transfer key. |
| AM_00104 | Please provide value of 'encryptionAlgorithmFETransfer' and 'secretFETransfer' in secret. | An encrypted body, and the secret has no transfer key. |
| AM_00106 | Payload expired. | The body is older than feTransferDataValidityInSeconds. |
| AM_00108 | Please provide field 'createdAt' with current time in ISO format… | The encrypted body has no createdAt. |
Instances, custom APIs and files¶
| Code | Message | When |
|---|---|---|
| AM_00031 | Instance with name '{instanceName}' does not exist. | The instance of the URL or of the call is not there. |
| AM_00099 | Please provide valid API path. Can not find any user with path '{value}'. | No account has the user path of the URL. |
| AM_00057 | Path '{url}' does not exist. | No custom API with this path and method : 404. |
| AM_00073 | Unable to find custom API with name '{name}'. | Is valid data for custom API or reset custom API cache names a custom API that is not there. |
| AM_00096 | Unable to find system API with name '{name}'. | Reset system API cache names a system API that is not there. |
| AM_00100 | WebSocket event not found with name '{name}'. You can create this event in API Info → WebSocket Events. | Emit WebSocket event with an unknown event. |
| AM_00068, AM_00069 | Invalid request. Please provide valid value for header x-am-code-hash. / Migration script does not found with id '{apiId}'. | Code tried from the admin panel, without the item it belongs to. |
| AM_00120 | File upload is not supported in [{name}] API. | A file sent to a custom API whose settings do not take files. |
| AM_00121, AM_00122 | Minimum / Maximum file size supported is '{value}' bytes and you provided [{name}] file with '{value2}' bytes in '{field}' field. | A file too small or too big for the settings of the custom API. |
| AM_00123 | Allowed extensions are [{value}] and you provided file '{name}' with extension '{value2}'. | A file of a kind the settings do not allow. |
| AM_00124 | Allowed fields are [{value}] and you have provided value in field '{field}'. | A file under a field name the settings do not allow. |
| AM_00125 | Please provide ['oracleDBUsername', 'oracleDBPassword', 'oracleDBPrivilege']. | Is valid connection string for Oracle, without its user. |
Messages API Maker 4 never sends¶
i18N Management lists these templates too, but API Maker 4 does not answer them : AM_00016, AM_00064, AM_00070, AM_00071, AM_00072, AM_00074, AM_00075, AM_00076, AM_00077, AM_00078, AM_00079, AM_00081, AM_00082, AM_00107, AM_00110.
Translate them¶
- Open APIs & Logic → i18N Management and add a language.
- Change the text of any code. Your own messages (
errorListof a custom API, the texts your code throws) can have a translation too. - Send the name of the language in
x-am-internationalization. Every message of the answer follows it.
See Internationalization.