search
Homephp教程php手册微信通用接口文档

微信通用接口文档

Jun 13, 2016 am 11:15 AM
httpandinteractionusemediaaccomplishDeveloperWeChatinterfacedocumentyesserverIntroductionaskUniversal

简介

通用接口是使用HTTP请求,让开发者直接与微信服务器交互,实现媒体文件上传、媒体文件获取等功能,达到获取图片、语音、视频等媒体文件的目的。

调用接口所需要的access_token必须通过获取凭证接口获取。

获取凭证

接口说明

在使用通用接口前,你需要做以下两步工作:

1.拥有一个微信公众账号,并获取到appid和appsecret(在公众平台申请自定义菜单功能,开启开发者模式,填写URL与Token后获得)

2.通过获取凭证接口获取到access_token

注意:

access_token是第三方访问api资源的票据;
access_token对应于公众号是全局唯一的票据,重复获取将导致上次获取的access_token失效。

请求说明

http请求方式: GET
https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET

参数说明

参数 是否必须 说明
grant_type 获取access_token填写client_credential
appid 第三方用户唯一凭证
secret 第三方用户唯一凭证密钥,既appsecret

返回说明

正确的Json返回结果:

{"access_token":"ACCESS_TOKEN","expires_in":7200}
参数 说明
access_token 获取到的凭证
expires_in 凭证有效时间,单位:秒

错误的Json返回示例:

{"errcode":40013,"errmsg":"invalid appid"}

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

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

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft