benborla/jobadder-api-client 问题修复 & 功能扩展

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

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

benborla/jobadder-api-client

Composer 安装命令:

composer require benborla/jobadder-api-client

包简介

JobAdder API Client

README 文档

README

A PHP API client for JobAdder, produced via jane-openapi

Installation

composer require varspool/jobadder-api-client

Usage

The namespace is BenBorla\JobAdder. The main client is BenBorla\JobAdder\Client. The Client class provides access to a set of API resources:

$contacts = $client->contacts()->findContacts(['limit' => 3]);
$ads = $client->jobAds()->getJobAds();

You can also access the resources directly from the BenBorla\JobAdder\V2\Resource namespace.

Instantiating a Client

The Client (and any Resource objects you create yourself) need to be given a configured HTTP client to be able to communicate with JobAdder. This HTTP client should implement the HttpClient or the HttpAsyncClient from HTTPlug. There are HTTPPlug adapters for most popular HTTP clients in PHP (e.g. Guzzle)

Here's how you might use a Guzzle 6 client with this library:

  • Install the Guzzle adapter: composer require php-http/guzzle6-adapter

  • Pass the Guzzle client into the JobAdder client via an adapter:

    use GuzzleHttp\Client as GuzzleClient;
    use BenBorla\JobAdder\Client as JobAdderClient;
    use Http\Adapter\Guzzle6\Client as GuzzleAdapter;
    
    $guzzle = new GuzzleClient($options);
    $http = new GuzzleAdapter($guzzle);
    $jobadder = new JobAdderClient($http);

OAuth and the Authorization header

Because the client is injected, you can configure things like the base URI (you should probably use the api part of the OAuth response from JobAdder), and the Authorization header:

// Get these both from the OAuth token response
$api = 'https://localapi.jobadder.com/v2';
$token = 'abcdef01234567890';

$guzzle = new GuzzleClient([
    'base_uri' => $api,
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

Note that this client doesn't deal with the OAuth flow; it can take over once you have a valid access token.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-04-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固