in reply to failure: 400

To start with "Each request also requires a nonce. A nonce is an integer number, that needs to increase with every API request. It's value has to always be greater than the previous request. It is used to ensure identical API requests have different signatures, making impossible for someone to copy your API requests and re-execute them later on."

You have

Apiauth-Nonce => 'sdfsdf',

Which is not an incrementing integer. However based on past experience you're likely not posting what you actually run, and haven't bothered to read or understand the documentation. Queue wasting everyone's time, including your own.

Replies are listed 'Best First'.
Re^2: failure: 400
by bigup401 (Pilgrim) on Jan 05, 2019 at 11:40 UTC

    am sorry to pest bad parameters, bt when i run the code. i expect results like. wrong Apiauth-Key, Apiauth-Nonce or something to show that am connecting to api in right way. ther must be some like unauthorized or wrong authentication to request anything on this api. but i was getting

    error. the page just brings 500 error code. so thats why i had to look for that error by adding the above code to the top of my script and i found out the error was failure: 400

    BEGIN { print "Content-type: text/plain\n\n"; }

    that means am sending bad format of message to api

      As a first step, stop running your programs as CGI programs. Run them from the console.

        even tho i run it in console. same error

        Argument "Key" isn't numeric in subtraction (-) at test.pl line 10. Argument "Apiauth" isn't numeric in subtraction (-) at test.pl line 10 +. Argument "Nonce" isn't numeric in subtraction (-) at test.pl line 10. Argument "Apiauth" isn't numeric in subtraction (-) at test.pl line 10 +. Argument "Signature" isn't numeric in subtraction (-) at test.pl line +10. Argument "Apiauth" isn't numeric in subtraction (-) at test.pl line 10 +. failure: 500 Press any key to continue . . .

        @Corion am running as CGI program coz am building CGI app

        cant run it from console. when its not console program

        i need to see the resluts of wat am buiding

      Your code, unedited tells you what's wrong:

      marto@Shemp:~/code$ ./rubbish.pl Content-type: text/plain Useless use of a constant ("currency") in void context at ./rubbish.pl + line 25. Useless use of a constant ("USD") in void context at ./rubbish.pl line + 25. Useless use of a constant ("amount") in void context at ./rubbish.pl l +ine 25. Useless use of a constant ("500") in void context at ./rubbish.pl line + 25. Useless use of a constant ("description") in void context at ./rubbish +.pl line 25. Useless use of a constant ("hey") in void context at ./rubbish.pl line + 25. Useless use of a constant ("internal") in void context at ./rubbish.pl + line 25. Argument "Key" isn't numeric in subtraction (-) at ./rubbish.pl line 1 +3. Argument "Apiauth" isn't numeric in subtraction (-) at ./rubbish.pl li +ne 13. Argument "Nonce" isn't numeric in subtraction (-) at ./rubbish.pl line + 13. Argument "Apiauth" isn't numeric in subtraction (-) at ./rubbish.pl li +ne 13. Argument "Signature" isn't numeric in subtraction (-) at ./rubbish.pl +line 13. Argument "Apiauth" isn't numeric in subtraction (-) at ./rubbish.pl li +ne 13. failure: 400

      We've been over the whole CGI development topic before, so I won't waste my time. Run things command line before trying them in the browser, if you are running things as CGI scripts learn how to debug them. Re read the responses to your previous posts, because this has all been explained to you before. Your inconsistent, illogical approach to problems, failure to take advice and not learning from your past experiences/mistakes are the fundamental issues.