Download the PHP package topthink/think-api without Composer

On this page you can find all versions of the php package topthink/think-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package think-api

Think Api SDK For PHP

ThinkAPI

ThinkAPIThinkPHP官方推出的统一API接口服务,提供接口调用服务及开发SDK,旨在帮助ThinkPHP开发者更方便的调用官方及第三方的提供的各类API接口及服务,从而更好的构建开发者生态,详细参考这里

安装依赖

如果已在系统上全局安装 Composer ,请直接在项目目录中运行以下内容来安装 Think Api SDK For PHP 作为依赖项:

一些用户可能由于网络问题无法安装,可以使用阿里云 Composer 全量镜像

快速使用

以查询[身份证所属地区]()接口为例

use think\api\Client;

$client = new Client("YourAppCode");

$result = $client->idcardIndex()
    ->withCardno('身份证号码')
    ->request();

所有的接口服务和方法都支持IDE自动提示和完成(请务必注意方法大小写必须保持一致),基本上不需要文档即可完成接口开发工作,ThinkAPI所有的API调用服务必须设置appCode值,用于接口调用的身份认证。

AppCode的值可以在官方服务市场->我的服务->安全信息里面获取到,每个用户账号拥有一个唯一的AppCode值(请不要随意泄露)。

该SDK服务仅支持官方已经接入的API接口(所有支持的接口都在官方API市场),目前接口数量正在扩充中,你可以联系我们反馈你需要的API接口,我们来统一进行接入。

返回数据

ThinkAPI所有的接口返回数据为JSON格式,通用规范如下:

名称 类型 说明
code int 返回码,0 表示成功 其它表示失败
message string 返回提示信息
data object 返回数据

如果为付费接口,则当code为0的时候计费,其中data包含的数据请参考具体的接口说明。


All versions of think-api with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.5 || ^7.0
topthink/think-helper Version ^1.0 || ^3.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package topthink/think-api contains the following files

Loading the files please wait ....