INVALID_PARAM
Encountering an error? Get help with AI tools
Error Cause
- Request parameter error: the format, type, or value of the passed parameter does not meet API requirements.
- Missing authentication parameters in the cloud invocation chain
Solution
General Parameter Checks
- Check if all required parameters are provided
- Verify parameter types are correct (string, number, boolean, etc.)
- Confirm parameter values are within allowed ranges
- Review API documentation to confirm parameter format requirements
- Check parameter names are correct, paying attention to case sensitivity
WeChat Mini Program Cloud Invocation Error: missing wxCloudApiToken
If you encounter the missing wxCloudApiToken error in WeChat CloudBase, it is usually caused by cloud invocation methods that do not comply with WeChat CloudBase requirements.
Problem Cause
missing wxCloudApiToken indicates that there is no cloud invocation credential and cloud invocation related interfaces cannot be called.
This is because cloud invocation has specific usage restrictions in WeChat CloudBase, mainly including:
- Must be initiated from the mini program: Cloud invocation must be triggered by the mini program and does not support initiation from the cloud console, Web, cloud function calling cloud function, scheduled trigger cloud function, etc. (except for cloud function scheduled triggers set through WeChat IDE).
Solution
Ensure Initiation from Mini Program
- Ensure all cloud invocations are triggered through the mini program, rather than through the cloud console or other non-WeChat methods.
- If you need to initiate cloud invocation in a cloud function, ensure that the cloud function is triggered by the mini program.
Use WeChat IDE to Set Scheduled Triggers
- If you need to schedule trigger cloud functions and perform cloud invocation, you can use WeChat Developer Tools (WeChat IDE) to set scheduled triggers.
- In WeChat Developer Tools, enter the cloud development console, select the corresponding cloud function, and set the scheduled trigger rules.
Check Cloud Function Trigger Method
- Ensure the cloud function trigger method is from the mini program, for example through button clicks, page loads, and other user interaction behaviors.
- Avoid using non-mini program trigger methods, such as directly calling cloud functions in the cloud console or calling through Web API.
Related Error Example
{
"errorCode": -1,
"errorMessage": "User code exception caught",
"stackTrace": "Error: errCode: -501007 invalid parameters | errMsg: urlscheme.generate:fail missing wxCloudApiToken 请前往云开发AI小助手查看问题:https://tcb.cloud.tencent.com/cloud-admin#/copilot?q=INVALID_PARAM"
}