spinque/query-api 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

spinque/query-api

最新稳定版本:v0.0.1

Composer 安装命令:

composer require spinque/query-api

包简介

PHP query API for spinque desk

README 文档

README

Library to use the Spinque Query API in your PHP project.

The Spinque Query API is an HTTP API to retrieve search results for queries. Also check out the documentation of the Spinque Query API.

Installing

This package can be used through composer. In your composer.json file, specify:

  "require": {
      "spinque/query-api": "dev-main"
  }

then, in order to install the dependencies for your project:

$ php composer.phar update

Documentation

For documentation on the Spinque Query API itself, please see this.

Defining queries

<?php

require_once __DIR__ . '/vendor/autoload.php';

$api = new Api(
    array(
        'workspace' => 'course-chris',
        'config' => 'default',
        'api' => 'movies'
    )
);


$queries = [
    new Query('movie_search', array('query' => 'Keanu Reeves'))
];

try {
    echo $api->fetch($queries);
} catch (Exception $e) {
    echo $e;
}

Authentication

Some Spinque APIs require authentication using OAuth 2.0. Support for the Client Credentials flow (for server applications) is provided through this library:

<?php

require_once __DIR__ . '/vendor/autoload.php';

$api = new Api(
    array(
        'workspace' => 'course-chris',
        'config' => 'default',
        'api' => 'movies',
        'authentication' => array(
            'authServer' => 'https://login.spinque.com',
            'clientId' => '<CLIENT-ID>',
            'clientSecret' => '<CLIENT-SECRET>',
        )
    )
);

Note: the Client ID and Client Secret can be generated by creating a new System-to-System account in the Settings > Team Members section of Spinque Desk.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 4
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-03