search
HomeDatabaseMysql Tutorial微信公众帐号开发中的appid、appsecret和access

鱼渔发现有不少初次接触微信公众帐号开发的网友会问类这样的问题: 订阅号找不到appid和appsecret? 成为开发者没有得到AppId和AppSecret,请问怎么解决? 哪些地方需要用access_token? 原始ID gh_116745c59179 微信号 pocketccsu 启用开发模式 没有appid和

鱼渔发现有不少初次接触微信公众帐号开发的网友会问类似这样的问题:

  • 订阅号找不到appid和appsecret?
  • 成为开发者没有得到AppId和AppSecret,请问怎么解决?
  • 哪些地方需要用access_token?
  • 原始ID gh_116745c59179 微信号 pocketccsu 启用开发模式 没有appid和appsecret 想进一步开发受阻,麻烦管理员处理一下,谢谢!

这些问题是想关联的,鱼渔在一起解释下。

首先订阅号申请成功后,设置完了接口url和token,通过了验证,就可以成为开发者,但是还没有appid和appsecret,必须通过认证后才有。验证和认证完全是两回事,参见微信公众帐号的验证和认证有什么不同?。我觉得微信官方文档对这些问题虽然都有说明,但微信公众帐号管理后台的UI设计上还不够好,导致很多初学者有这些困惑。

AppID和AppSecret用于获取access_token。公众帐号对应着微信服务器上的一个账户,在开发模式下,不仅微信服务器可以对你的服务器发送消息和事件,你的服务器也可以反过来操纵微信服务器上你的账户,那么就需要一个账户密码,access_token就相当于这个密码。AppID、AppSecret是需要保密的,不要轻易告诉微信第三方服务商,除非确实需要。

access_token有效期为7200秒,可以用程序做个缓存,保存在数据库中,下次需要生成access_token是,先判断数据库中保存的是否在两个小时之内,如果是就直接取来使用,如果不是,再向微信服务器重新获取。不过获取access_token的接口调用限制是2000次每天,一般调试程序应该够用了,直接调用即可,不必缓存。下次鱼渔会介绍一个很好的微信公众平台php开发包wechat-php-sdk,并给出获取access_token的代码。

-----------------------------------------------------------------------------------------------------------------------------------------
鱼渔解读微信公众平台开发(http://blog.csdn.net/yidongapi),谢谢!

欢迎关注公众帐号:weixintizi,我的个人网站:微信梯子

微信公众帐号开发中的appid、appsecret和access

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How to sort and rank data in MySQLHow to sort and rank data in MySQLApr 29, 2025 pm 03:48 PM

In MySQL, sorting uses the ORDERBY clause, and ranking uses the RANK(), DENSE_RANK(), and ROW_NUMBER() functions. 1. Sort: Use ORDERBY clause, such as SELECT*FROMemployeesORDERBYsalaryDESC; 2. Ranking: Use window functions, such as SELECTemployee_name, salary, RANK()OVER(ORDERBYsalaryDESC)ASrankFROMemployees; these operations are based on SQL query optimizer and execution engine, and are often used to sort quickly or merge sort, and ranking depends on window function calculation.

Creation and calling methods of MySQL stored proceduresCreation and calling methods of MySQL stored proceduresApr 29, 2025 pm 03:45 PM

To create and call stored procedures in MySQL, follow the following steps: 1. Create stored procedures: Use the CREATEPROCEDURE statement to define stored procedures, including names, parameters, and SQL statements. 2. Compile stored procedures: MySQL compiles stored procedures into executable code and stores them. 3. Call stored procedure: use CALL statement and pass parameters. 4. Execute stored procedures: MySQL executes the SQL statements in it, processes parameters and returns the result.

How to set up MySQL service automatically startsHow to set up MySQL service automatically startsApr 29, 2025 pm 03:42 PM

The MySQL service can be set to automatically start on Windows, Linux, and macOS. 1) On Windows, use the command "scconfigmysqlstart=auto" to configure. 2) On Linux, enable it using "sudosystemctlenablemysql". 3) On macOS, create and load the launchd configuration file to achieve automatic startup.

How to view detailed structure information of MySQL tablesHow to view detailed structure information of MySQL tablesApr 29, 2025 pm 03:39 PM

The methods to view the MySQL table structure include: 1. Use the DESCRIBE command to view column information; 2. Use the SHOWCREATETABLE command to view table creation statements; 3. Use information_schema to query more detailed information. These methods help to quickly understand table structure and improve work efficiency.

Detailed explanation of the installation steps of MySQL on macOS systemDetailed explanation of the installation steps of MySQL on macOS systemApr 29, 2025 pm 03:36 PM

Installing MySQL on macOS can be achieved through the following steps: 1. Install Homebrew, using the command /bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". 2. Update Homebrew and use brewupdate. 3. Install MySQL and use brewinstallmysql. 4. Start MySQL service and use brewservicesstartmysql. After installation, you can use mysql-u

How to use conditional filtering and grouping in MySQL queryHow to use conditional filtering and grouping in MySQL queryApr 29, 2025 pm 03:33 PM

In MySQL, conditional filtering is implemented through the WHERE clause and grouping is completed through the GROUPBY clause. 1. Use the WHERE clause to filter data, such as finding employees with salary above 5,000. 2. Use the GROUPBY clause to group and aggregate data, such as counting the number of employees by department. 3. Choose the appropriate index to optimize query performance and avoid using functions or expressions as WHERE conditions. 4. Combining subqueries and EXPLAIN commands improve the efficiency of complex queries.

How to clear MySQL table data but preserve table structureHow to clear MySQL table data but preserve table structureApr 29, 2025 pm 03:30 PM

In MySQL, clearing table data but preserving table structure can be implemented through the TRUNCATETABLE and DELETE commands. 1. The TRUNCATETABLE command quickly deletes all records and resets the self-increment column. 2. The DELETE command deletes data line by line, does not reset the self-increment column, and can delete specific records in combination with the WHERE clause.

Methods to deduplicate MySQL query resultsMethods to deduplicate MySQL query resultsApr 29, 2025 pm 03:27 PM

Deduplication in MySQL mainly uses DISTINCT and GROUPBY. 1.DISTINCT is used to return unique values, such as SELECTDISTINCTname, ageFROMusers. 2. GROUPBY realizes deduplication through grouping and can perform aggregation operations, such as SELECTid, name, MAX(created_at)aslatest_dateFROMusersGROUPBYname.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment