Sign in or 

|
evolanding |
Please help me with this error.
May 29 2008, 7:09 PM EDT
This code returns the error 'ERROR', which makes it impossible for me to debug.I was originally posting data via fsockopen, but it caused this error, so in order to eliminate any possibility of the error being on my end, I attempted to duplicate as much of the code as possible from the php wordpress plugin example, including using snoopy to handle the POST. $test = true; $host = ($test) ? 'togo.wetpaint.com' : 'wapi.wetpaint.com'; $path = '/UserService/login.do'; $devkey = 'you don't need this. trust me, it's correct'; $secret = 'this is a secret'; $user_id = 'jaytee'; $ts = time(); $parameters = array(); $parameters['output'] = 'api'; $parameters['key'] = $devkey; $parameters['ns'] = 'evolanding'; $parameters['cred.ts'] = $ts; $parameters['cred.sig'] = hash_hmac("sha1", $devkey.$user_id.$ts, $secret, false); $parameters['user.userId'] = $user_id; $parameters['user.email'] = 'jt%40evolanding.com'; $parameters['user.emailOptIn'] = 'false'; include "Snoopy.class.php"; $snoopy = new Snoopy; $urlbase = 'http://togo.wetpaint.com/UserService/login.do'; $snoopy->submit($urlbase,$parameters); print $snoopy->results; This yields the following XML: <response version="20080521145736"><failure><cause>ERROR</cause></failure></response> Any ideas why this would be happening? Do you find this valuable?
Keyword tags:
errors
impossible debugging
not enough information
|
|
phattchumpy |
1. RE: Please help me with this error.
May 29 2008, 7:41 PM EDT
Are you switching your developer key based on the environment (test/prod)? I'm seeing a bunch of invalid developer key errors on the togo.wetpaint.com side.
0
out of
1 found this valuable.
Do you?
|
|
evolanding |
2. RE: Please help me with this error.
May 29 2008, 7:49 PM EDT
I solved it myself. It was the %40 in the email, once I replaced that with an @, everything worked. Once I got it working, I also found that changing the namespace yields another plain, useless error message. So perhaps differentiating between bad email and bad namespace is in order?Also, in the event other people have trouble, the plain ERROR message will not be caused by the following: devkey (bad devkey yields an 'incorrect devkey' message) secret (secret is used to decode the sig, which will then yield an 'incorrect devkey' message) output (if it is not api, it will say 'request could not be processed') timestamp (also returns 'incorrect devkey') cred.sig will generate 'invalid devkey' if any of the component pieces are busted. user.userId is used to decode the sig, so if it doesn't match the component in the decoded sig, you get invalid devkey user.email will yield ERROR if it is faulty. user.emailOptIn will yield the same 'cannot be processed' error as 'output' if it doesn't match any of the accepted values. Perhaps some admins could even use this, to avoid suggested to people that ERROR is caused by a faulty 'output' variable. If output is not set, it clearly indicates this. If it isn't set to 'api', it says 'request could not be processed'. Unless I am mistaken, the output variable will NEVER cause just the word ERROR to appear. Note this when helping people in the future. ERROR = problem with email, or namespace. 1 out of 1 found this valuable. Do you? |
|
evolanding |
3. RE: Please help me with this error.
May 29 2008, 7:53 PM EDT
"Are you switching your developer key based on the environment (test/prod)? I'm seeing a bunch of invalid developer key errors on the togo.wetpaint.com side."I don't have a devkey for the prod environment. The first line of my script was setting 'test' to true, and the second line was loading the test env. The problem is solved. You might want to read my post below so you'll know how to diagnose error messages in the future. Do you find this valuable? |
|
phattchumpy |
4. RE: Please help me with this error.
May 29 2008, 7:55 PM EDT
Thank you for the informative post.Just to be clear, output not being set does not return ERROR, that is not at all what I was suggesting. On a call that supports both html and api output, using api may yield better information. I had not realized you were using the login call. Please post again if you continue to have issues. Do you find this valuable? |