Problem with API Auth (_user_id)

Talk about scripts, analytics, API, software, and shrinkers here.
Forum rules
WARNING: Tools in this forum are being supported or maintained by the original author and not Adf.ly Staff. Proceed at your own risk.
Post Reply
zeyst
Newbie
Posts: 2
Joined: Sun Mar 26, 2017 11:46 pm

Problem with API Auth (_user_id)

Post by zeyst » Sun Mar 26, 2017 11:59 pm

Though all my credentials are correct, it's popping me an error in your API about _user_id being incorrect

my _user_id is int:7434152, and it pops me that error, so yeah. Kind of confused.

Code: Select all

    # python 2.7
    >>>api = AdflyApiExample()
    >>>json.dumps(api.shorten('http://docs.python.org/library/json.html'),
      			    indent=4)
    {
    "errors": [
        {
            "msg": "Authentication failed. Either _user_id is not set or invalid.", 
            "code": 3
        }
    ], 
    "data": null, 
    "page": {
        "current": 1, 
        "total": 1
    }, 
    "warnings": []
}

zeyst
Newbie
Posts: 2
Joined: Sun Mar 26, 2017 11:46 pm

Post by zeyst » Mon Mar 27, 2017 12:03 am

This is also how I have my variables configured

Code: Select all

class AdflyApiExample():
  BASE_HOST = 'http://api.adf.ly'
  # TODO: Replace this with your secret key.
  SECRET_KEY = '**************************************' 
  # TODO: Replace this with your public key.
  PUBLIC_KEY = 'af5c1574c9587be09d8e9a0189c*****'
  # TODO: Replace this with your user id.
  USER_ID = 7434152
  AUTH_TYPE = dict(basic=1, hmac=2)
  
  

Post Reply