Issues with RESTful API

General Questions Issues with RESTful API

This topic contains 6 replies, has 1 voice, and was last updated by  Tyler 11 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #980 Reply


    Looking into the RESTful API. I am getting an error when I attempt to use the API keys with the list. The error I get is that my public key is incorrect.

    I have gotten the key from the list, am using the shortlist name and I am using the example script on the website that is included in the documentation. Specifically I am using the section to subscribe an email to a list. Any ideas?

    This is the return value I get:

    Content-Type: text/html; charset=ISO-8859-1

    $VAR1 = {
              'errors' => {
                            'invalid_public_key' => 1,
                            'invalid_digest' => 1
              'status' => 0
    #1032 Reply

    #1141 Reply


    Hi there. This did resolve the issue. I am attempting to build out a perl script to meet my needs but I am unsure what happened but the test script (which i had only used the “subscribe” option of) had been working just fine until this afternoon but now it returns an error just showing “invalid_digest = 1”

    Any suggestions as to what might be causing this sudden behavior on both the script I am writing and the example scripts?

    I have verified that the line still exists in .htaccess and it is passing the correct public/private keys. Is there a debug option that might give me more information about what is happening?

    #1154 Reply


    Ive gotten the example script to work again. My personal modified version still wont work though the contents of Dumper($ws) are the same when printed.

    Any suggestions on where to look?

    #1155 Reply


    I have gone through each variable I am declaring in my version of the script and used

    use Digest::MD5 qw(md5 md5_hex md5_base64);

    with the md5_hex function to compare all variables to the working example to ensure I am not accidentally doing something strange like including whitespace or non-printing characters. Everything is identical except for the output of $param which changes md5 between instances of execution even on the working script.

    At this point I see nothing functionally different from what I am doing and what the example script does. I am even attempted to print the digest itself but it changes from execution to execution because the HASH variable of $param also changes between executions.

    My attempt here is to create a version of the example script which lets me define a script and have it dynamically assign the public and private keys so I can pass this off to my admin who is assigning new accounts to lists.

    I do not know where to keep digging into this as I do not understand why it isnt working at this point

    #1156 Reply


    More testing, totally scrapping my script and just adding the argument parser to the working script shows me that if I pass ANY variable on the command line to the script it gives a digest error. This apparently has something to do with my usage of declaring a variable with @ARGV[0]

    #1157 Reply


    I have figured out how to work around the issue by using undef @ARGV; immediately after I no longer needed the variables I defined anymore.

    My script is working now

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Issues with RESTful API
Your information: