0

从 podio API 开始,速度不快..

<?php
define("CLIENTID", "###");
define("CLIENTSECRET", "####");
define("APPID", "###");
define("APPTOKEN", "#####");
require_once 'podio/PodioAPI.php';
Podio::setup($clientid, $clientsecret);
if (!Podio::isauthenticated())
{
    try {
        Podio::authenticatewithapp($appid, $apptoken);
    }
    catch(PodioError $e) {
        die(printr($e->body));
    }
}
?>

输出:

Array ( [errorparameters] => Array ( ) [errordetail] => [errorpropagate] => [request] => Array ( [url] => http://api.podio.com/oauth/token [querystring] => [method] => POST ) [errordescription] => Invalid value "" (string): must be integer [error] => invalidvalue ) 1

问题在于

Podio::authenticatewithapp($appid, $apptoken);

即使定义了数据,它也不会传递数据。我的编码很生疏,这是我第一次使用 API。

4

1 回答 1

0

我很确定你的 $appid 和 $apptoken 没有定义,这就是为什么你得到 "" 字符串,非整数错误。您可以使用适当的值设置它们。但是,由于您已经定义了常量 APPID 和 APPTOKEN,因此您可以使用如下所示的:

   Podio::authenticate_with_app(APPID, APPTOKEN);

(我也不确定你为什么指的是没有下划线的 podio 方法甚至 print_r(),所以它应该是 is_authenticated(),我假设你的实际代码不是这样,否则它不会工作)

于 2015-02-11T00:50:47.043 回答