Getting the AppID and AppKey?

The very first step, getting your profile credentials, isn't as clear as it should be. The given example:

app_id  = "<my_app_id>"

app_key  = "<my_app_key>"

Has no counterpart in the credentials page. There's App Name, and Credentials. Supplying either for the two variables causes authentication to fail with code 403. To demonstrate, I've changed the app_id to different numbers and letters:

import  json
import  requests
app_id = "11100aaa"
app_key = "N/A's App"

endpoint = "entries"
language_code = "en-gb"
word_id = "sing"
url = "https://od-api.oxforddictionaries.com/api/v2/" + endpoint + "/" + language_code + "/" + word_id.lower()

r = requests.get(url, headers = {"app_id": app_id, "app_key": app_key})
print("code {}\n".format(r.status_code))
print("text \n" + r.text)
print("json \n" + json.dumps(r.json()))

So what am I doing wrong here? This is step one, and it doesn't work.

Tagged:

Comments

  • TaisFukushimaTaisFukushima Member, Administrator, Moderator admin

    Hello @FiftyTifty

    Could I please confirm that you have an API account with us? I couldn't find your credentials to check if there is something wrong.

    When you create an API account, you will have an API ID and Key. These API credentials should be in your account homepage under the Credentials button.

    Could you please use your credentials in and ?
    It seems that the information added in the app_key (app_key = "N/A's App") isn't the usual key created by our system, but the name of the application. It can explain the error message you're receiving.

    Please. let me know if it worked.

Sign In or Register to comment.