1. Jeffrey Goettsch
  2. py-pushnotify
Issue #11 invalid

api_key problem

Anonymous created an issue

unable to login .. wanted to comment on my issue :- here is the code. and yes the API key is actually from NMA but how do i link my cellphone here ?

client = pushnotify.get_client('nma',NMA_PROVIDER_KEY, self._application) try: success = True message = 'The message has been sent to your notify my Android client.' client.add_key(NMA_PROVIDER_KEY) result = client.notify(self._description, self._event, split=True) print result except pushnotify.exceptions.ApiKeyError as e: success = False message = 'There was an error sending your message: ' \

Comments (3)

  1. Jeffrey Goettsch repo owner

    I tried to clean that up. Is this right?

    client = pushnotify.get_client('nma',NMA_PROVIDER_KEY, self._application)
    try:
        success = True
        message = 'The message has been sent to your notify my Android client.'
        client.add_key(NMA_PROVIDER_KEY)
        result = client.notify(self._description, self._event, split=True)
        print result
    except pushnotify.exceptions.ApiKeyError as e:
        success = False
        message = 'There was an error sending your message: ' \
    
  2. Jeffrey Goettsch repo owner

    This code works for me with my API key.

    The exception you posted previously was:

    pushnotify.exceptions.FormatError: ("Parameter 'apikey' has one or more keys with invalid length.", 400)
    

    That means there is a problem with your API key. It should be a 48 character alpha-numeric string.

    I would log in to your NMA account and verify you have the correct API key. If you want to verify if your phone is set up correctly, try sending an email to the NMAMail address you see in your account settings.

    If you still have trouble getting your API key and phone set up, contact the NMA dev through his website; he's usual quick to respond and very helpful.

  3. Log in to comment