mcmatters / upwork-api
dev-master
2023-02-14 19:54 UTC
Requires
- php: >=8.0
- mcmatters/ticl: dev-master
This package is auto-updated.
Last update: 2024-10-15 00:00:25 UTC
README
Installation
composer require mcmatters/upwork-api
Usage
<?php declare(strict_types=1); require './vendor/autoload.php'; $clientId = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $clientSecret ='XXXXXXXXXXXXXXXX'; $redirectUrl = 'https://example.com/upwork' $authClient = new \McMatters\UpworkApi\UpworkAuthClient($clientId, $clientSecret); $code = $authClient->authorize($redirectUrl, true); $accessToken = $authClient->accessToken($redirectUrl, $code); $client = new \McMatters\UpworkApi\UpworkClient($clientId, $clientSecret, $accessToken); $jobs = $client->job()->search(['q' => 'Laravel', 'job_status' => 'open']); $job = $client->job()->getJobProfile($jobs['jobs'][0]['id']);