Skip to main content

Cause of the missing wxCloudApiToken error

When encountering the missing wxCloudApiToken error in WeChat Cloud Development, it is usually caused by the method of initiating cloud calls not meeting the requirements of WeChat Cloud Development.

Cause of the Issue

The missing wxCloudApiToken` error indicates the absence of a cloud call token, preventing access to cloud call interfaces.

Because cloud calls in WeChat Cloud Development have specific usage restrictions, primarily including:

  • Must be initiated from the Mini Program side: Cloud calls must be triggered from the Mini Program side. Initiating from the cloud console, Web side, cloud functions calling cloud functions, or scheduled triggers (except for cloud function scheduled triggers set via the WeChat IDE) is not supported.

Solutions

Ensure initiation from the Mini Program side

  • Ensure all cloud calls are triggered from the Mini Program side, rather than through the cloud console or other non-WeChat methods.
  • If you need to initiate a cloud call within a cloud function, ensure that cloud function is triggered by the Mini Program side.

Setting up scheduled triggers in WeChat IDE

  • If you need to schedule cloud function triggers and perform cloud calls, you can use WeChat Developer Tools (WeChat IDE) to set up scheduled triggers.
  • In WeChat Developer Tools, access the Cloud Development Console, select the corresponding cloud function, and configure scheduled trigger rules.

Check Cloud Function Trigger Methods

  • Ensure cloud functions are triggered from the Mini Program side, such as through user interactions like button clicks, page loading, etc.
  • Avoid using trigger methods from non-Mini Program sides, such as directly invoking cloud functions in the cloud console or calling via Web-side APIs.

Similar Issues

  1. Why must cloud calls be initiated from the Mini Program side?
  2. How to set up scheduled triggers for cloud functions in WeChat IDE?
  3. Can cloud functions be invoked via Web-side APIs?
  4. How to resolve the missing wxCloudApiToken error?
  5. What are the restrictions on cloud calls in WeChat Cloud Development?
  6. How to ensure cloud functions are triggered by the Mini Program side?
  7. What is the proper way to initiate cloud calls in WeChat Cloud Development?
  8. What does the getWXCloudApiToken failed error mean?
  9. What is the setup method for scheduled triggers of cloud functions in WeChat Cloud Development?
  10. How to avoid the missing wxCloudApiToken error?
{
"errorCode": -1,
"errorMessage": "User code exception caught",
"stackTrace": "Error: errCode: -501007 invalid parameters | errMsg: urlscheme.generate:fail missing wxCloudApiToken Please go to the Cloud Development AI Assistant to view the issue: https://tcb.cloud.tencent.com/cloud-admin#/copilot?q=INVALID_PARAM"
}