doyoubuzz/api-helper

DoYouBuzz API Helper

1.0.0 2015-06-11 10:33 UTC

This package is auto-updated.

Last update: 2024-09-12 03:33:36 UTC


README

如果你想在PHP项目中使用DoYouBuzz,这个项目可以帮助你。

安装

你可以通过使用 Packagist 来安装这个库。

在你的 composer.json 文件中添加以下内容。Composer 将处理自动加载。

{
    "require": {
        "doyoubuzz/api-helper": "dev-master"
    }
}

使用方法

<?php
// include your autoloader then :
$apiKey = 'XXX';
$apiSecret = 'YYY';
$dyb = new \DoYouBuzz\ApiHelper\DoYouBuzzAPI($apiKey, $apiSecret);
$dyb->connect(true);
$user = $dyb->getUser();
if ($user) {
    echo 'Utilisateur : ' .  $user->firstname . ' ' . $user->lastname . '<br>';

    $mainCv = $dyb->getMainCv();
    if ($mainCv) {
        echo 'Cv : ' . $mainCv->title . '<br>';
    }
}

方法

你可以使用的方法列表

  • getUser : 返回一个包含用户数据(以及带有标题的简历)的 \stdClass 对象
  • getMainCv : 返回主简历作为 \stdClass 对象
  • getCv(:id) : 给定一个 ID 并获取简历作为 \stdClass 对象
  • getStatistics : 返回用户的统计数据
  • getEmploymentPreferences : 返回用户的就业偏好
  • getDisplayOptions(:id, :type) : 返回给定类型的显示选项(web, mobile, print)
  • getAccessToken : 返回访问令牌
  • setAccessToken(:token, :secret): 你可以设置访问令牌
  • clearAll : 从存储中删除所有数据(默认为 Session)
  • connect(:redirect = false, :callbackUrl) : 将连接你的用户并获取访问令牌

如果你想知道 \stdClass 上可用的属性,请参阅我们 文档 上的 JSON 格式。