WeChat universal interface document_php tutorial

Source: Internet
Author: User
Common Interface documentation. Overview The Common Interface allows developers to directly interact with the server through HTTP requests. This allows developers to upload and obtain media files and other functions to obtain images, audios, and videos.

The common interface is to use HTTP requests to allow developers to directly interact with the server and implement functions such as uploading and obtaining media files to obtain images, audios, videos, and other media files.

The access_token required to call an interface must be obtained through the interface for obtaining creden.

Obtain the credential

Interface Description

Before using a common interface, you need to do the following two steps:

1. have a public account and get the appid and appsecret (apply for the custom menu function on the public platform, enable the developer mode, and enter the URL and Token to get it)

2. access access_token through the credential acquisition interface

Note:

Access_token is the ticket for a third party to access api resources. access_token corresponds to the public account, which is globally unique. repeated acquisition will invalidate the last access_token obtained.

Request description

Http request method: GEThttps: // api.weixin.qq.com/cgi-bin/token? Grant_type = client_credential & appid = APPID & secret = APPSECRET

Parameter description

Parameters Required? Description
Grant_type Yes Obtain access_token and enter client_credential
Appid Yes Unique third-party user credential
Secret Yes The unique credential key of a third-party user, which is appsecret

Return description

Correct Json return results:

{"access_token":"ACCESS_TOKEN","expires_in":7200}
Parameters Description
Access_token Obtained credential
Expires_in Valid credential time, in seconds

Example of returned error Json:

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

The universal interfaces of the middleware are HTTP requests that allow developers to directly interact with the server and implement functions such as media file uploading and obtaining media files to obtain images, audios, and videos...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.