用户语音';s在PHP中的OAuth实现


UserVoice's OAuth Implementation in PHP

我可以通过调用和未经授权的请求获得UserVoice的记录,但现在我想创建和更新需要OAuth的东西,但我找不到UserVoice对OAuth和使用UserVoice API创建/更新/删除的PHP实现,有人可以指导我如何实现这样的东西吗??

我们最近已经着手于此,并发布了一个基于OAuth的库,这使得从PHP版本5的应用程序访问UserVoice API更加容易。

关于如何使用的访问令牌创建票证的示例user@example.com:

<?php
    require_once('vendor/autoload.php'); // Using Composer
    $client = new 'UserVoice'Client('subdomain-name', 'API KEY', 'API SECRET');
    $access_token = $client->login_as('user@example.com');
    $result = $access_token->post("/api/v1/tickets", array(
            'ticket' => array(
                'state' => 'open',
                'subject' => 'PHP SDK',
                'message' => "Would you have any OAuth example for PHP?"
            )
    ));
?>

尽管图书馆仍在开发中,但我相信它对你已经很有用了。请参阅博客文章和更多示例,如以账户所有者的身份回复门票:

http://developer.uservoice.com/docs/api/php-sdk/