Legend

Forum

Unread topics or posts

Topic

Unread posts

Locked

Announcement

Forums > Developers

wrong token



AuthorMessage
stebi666

Posted: Jun 23, 2010
Score: 0



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?
Toodledo

Administrator
Posted: Jun 23, 2010
Score: 0



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



yes I mean that.
Toodledo

Administrator
Posted: Jun 24, 2010
Score: 0



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



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



Hi, I work on it and I manage to get the key by myself. Thank you anyway
Toodledo

Administrator
Posted: Jun 26, 2010
Score: 0



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.


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



Toodledo Forums > Developers

Contact Us | Blog | API | Help | Forums Privacy | Terms | Copyright © 2006-2012