Code Monkey home page Code Monkey logo

php-rtm's People

Contributors

bartosz-maciaszek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-rtm's Issues

Getting value of particular array-key(protected) from response object?

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.

How to add task to a tasklist?

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?

Unable to obtain authentication token

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.