You are not logged in.

#1 2009-02-25 11:09 pm

Crax
Member
Registered: 2009-02-25
Posts: 1

Told my key is invalid using http://www.stopforumspam.com/add

I just signed up and received an API key in my email which matches the one from the api keys link.  When I attempt to submit a user through the /add page, I get a Data Not Submitted - Could not validate API key message.

Last edited by Crax (2009-02-25 11:09 pm)

Offline

#2 2009-02-26 12:43 am

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: Told my key is invalid using http://www.stopforumspam.com/add

You MUST remove all spaces from the end of the API key in the form. 99% of the time, its because someone copy/pasted the copy and it put a space at the end.

Offline

#3 2009-10-28 7:16 pm

anse
Member
Registered: 2009-10-28
Posts: 5

Re: Told my key is invalid using http://www.stopforumspam.com/add

I have the same problem but using the HTTP POST API - and I'm unsure how to set up the PHP script for it. This is what I have:

$host = 'www.stopforumspam.com';
$sock = fsockopen($host, 80, $errno, $errstr, 10);
fputs($sock, "POST /post.php?username=".urlencode($username)."&ip_addr=".urlencode($lastip)."&email=".urlencode($email)."&api_key=XXXXX HTTP/1.1\n");
fputs($sock, "Host: ".$host."\n");
fputs($sock, "Connection: close\n\n");
fclose($sock);

I keep getting a "Could not validate API key". Using the same key I can submit data on the /add page manually. What's wrong?

Offline

#4 2009-10-28 7:30 pm

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: Told my key is invalid using http://www.stopforumspam.com/add

At any point, did these keys work when submitting data in the same way that they are now failing?  Get you PM me your keys please (or email) and I will look at them

Offline

#5 2009-10-29 8:45 am

anse
Member
Registered: 2009-10-28
Posts: 5

Re: Told my key is invalid using http://www.stopforumspam.com/add

Wrote you a pm with the key. The key only works on your /add page, but not on post.php with the above mentioned PHP snippet. I guess there's some error in it. Could you provide me a working example snippet? Probably put that on the webpage as well, could be helpful for others.

Offline

#6 2009-10-30 10:56 pm

anse
Member
Registered: 2009-10-28
Posts: 5

Re: Told my key is invalid using http://www.stopforumspam.com/add

pedigree, did you find the time to check my key?

Offline

#7 2009-10-31 2:24 am

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: Told my key is invalid using http://www.stopforumspam.com/add

I sent you an email, I couldnt find anything wrong with the key

Offline

#8 2009-10-31 8:32 am

anse
Member
Registered: 2009-10-28
Posts: 5

Re: Told my key is invalid using http://www.stopforumspam.com/add

Oh thanks for the hint - your mail was catched by Google Mails's spam filter (kind of ironic). Will try using your snippet and get back to report if it works.

Offline

#9 2009-10-31 9:06 am

anse
Member
Registered: 2009-10-28
Posts: 5

Re: Told my key is invalid using http://www.stopforumspam.com/add

Works fine now! Differences to my snippet:
* content-length specified
* user agent included
* HTTP 1.0, not 1.1
* post parameters in content, not in path

Thanks again for your help, pedigree.

Offline

#10 2009-10-31 10:17 am

pedigree
uıɐbɐ ʎɐqǝ ɯoɹɟ pɹɐoqʎǝʞ ɐ buıʎnq ɹǝʌǝu ɯ,ı
From: New Zealand
Registered: 2008-04-16
Posts: 7,056

Re: Told my key is invalid using http://www.stopforumspam.com/add

Glad to help out, even more so if youre going to add to the database smile

Offline

Board footer

Powered by FluxBB

Close
Close