bartosz-maciaszek / php-rtm Goto Github PK
View Code? Open in Web Editor NEWRemember The Milk API client for PHP
Remember The Milk API client for PHP
This is the sample code I used....to get a particular task list:
$tasks = $rtm->getService(Rtm::SERVICE_TASKS);
$response = $tasks->getList("status:incomplete AND tag:work", 16594223, NULL, NULL);
print_r($response);
And this the sample response I am getting:
Rtm\DataContainer Object
(
[attributes:Rtm\DataContainer:private] => Array
(
[0] => Rtm\DataContainer Object
(
[attributes:Rtm\DataContainer:private] => Array
(
[id] => 19594773
[taskseries] => Rtm\DataContainer Object
(
[attributes:Rtm\DataContainer:private] => Array
(
[id] => 310899576
[created] => 2013-10-03T05:35:52Z
[modified] => 2013-11-06T17:24:36Z
[name] => A new task
[source] => js
[url] =>
[location_id] =>
)
)
)
)
)
)
I want to extract the value of [name]
. How can I do it? $response->getTaskSeries()->getName()
does not work.
I guess this type of serialization has already been implemented inside the class.
I have uploaded folders & files on my server & successfully authorized it. Now when ever I try to add a task it shows an error : Fatal error: Uncaught exception 'Rtm\Exception' with message 'Invalid signature'
Here is the code:
require_once 'bootstrap.php';
use Rtm\Rtm;
$rtm = new Rtm;
$rtm->setApiKey(API_KEY);
$rtm->setSecret(SECRET);
$token = file_get_contents("oauth.token");
$rtm->setAuthToken("$token");
$task = $rtm->getService(Rtm::SERVICE_TASKS);
$res = $task->add('New Task', '1698765', 0, 0);
print_r($res);
And print_r($res)
shows:
Fatal error: Uncaught exception 'Rtm\Exception' with message 'Invalid signature' in /home/user/public_html/rtm/src/Rtm/Client.php:125 Stack trace: #0 /home/user/public_html/rtm/src/Rtm/Client.php(81): Rtm\Client->createResponse('{"rsp":{"stat":...') #1 /home/user/public_html/rtm/src/Rtm/Rtm.php(358): Rtm\Client->call('rtm.tasks.add', Array) #2 /home/user/public_html/rtm/src/Rtm/Service/Tasks.php(59): Rtm\Rtm->call('rtm.tasks.add', Array) #3 /home/user/public_html/rtm/sample-app/land-bill.php(21): Rtm\Service\Tasks->add('New-Php', '16594225', 0, 0) #4 {main} Next exception 'Rtm\Exception' with message 'rtm.tasks.add: Invalid signature' in /home/user/public_html/rtm/src/Rtm/Client.php:85 Stack trace: #0 /home/user/public_html/rtm/src/Rtm/Rtm.php(358): Rtm\Client->call('rtm.tasks.add', Array) #1 /home/user/public_html/rtm/src/Rtm/Service/Tasks.php(59): Rtm\Rtm->call('rtm.tasks.add', Array) #2 /home/user/public_html/rtm/sample-app/land- in /home/user/public_html/rtm/src/Rtm/Client.php on line 85
What am I doing wrong?
When trying to obtain an API authentication token using $rtm->getService(Rtm::SERVICE_AUTH)->getToken(), I get the following error:
"Auth token not set".
It looks like the createRequest() method in Client.php assumes an auth_token parameter always exists. However, when using the rtm.auth.getToken API method, we won't be able to provide this parameter.
Is there a way to work around this?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.