ForumsDeveloperswrong token


wrong token
Author Message
stebi666

Posted: Jun 23, 2010
Score: 0 Reference
hi. I tried to get the token. if I write the url to get the token in the browser url it gives me the right token but if I try to get the token by a php api call like this:$token = file_get_contents('http://api.toodledo.com/api.php?method=getToken;userid=td4c208ec5cf266') it gives something different. wht should I do?
Jake

Toodledo Founder
Posted: Jun 23, 2010
Score: 0 Reference
What do you mean that it gives you the right token? The token will change on every call to getToken and there is no need to validate it. Do you mean that the key you generate with the token does not authenticate?
stebi666

Posted: Jun 24, 2010
Score: 0 Reference
yes I mean that.
Jake

Toodledo Founder
Posted: Jun 24, 2010
Score: 0 Reference
You must be generating the key incorrectly when you do it programatically. Double check your code and post a code snippet here if you want us to help you debug it.
stebi666

Posted: Jun 25, 2010
Score: 0 Reference
I calculated the key by this code:
<?php

$token = file_get_contents('http://api.toodledo.com/api.php?method=getToken;userid=td4c19f8d3e2f1c');
echo "$token";
echo '';
$pass = 'here i wrote my password';
$id = 'td4c19f8d3e2f1c';
$key = md5( md5($pass).$token.$id );




it's a part of the whole code.
stebi666

Posted: Jun 25, 2010
Score: 0 Reference
Hi, I work on it and I manage to get the key by myself. Thank you anyway
Jake

Toodledo Founder
Posted: Jun 26, 2010
Score: 0 Reference
It sounds like you figured it out, but the getToken API call returns XML, which you were not parsing out, so you were doing the md5 hash on too much data.
You cannot reply yet

U Back to topic home

R Post a reply

To participate in these forums, you must be signed in.