Problem with GET request

I am having trouble acessing the Oxford Dictionary API. I keep getting the error 'Authentication parameters missing'.

I believe I am not properly passing the api ID and key. I have referred to this documentation: https://developer.oxforddictionaries.com/documentation/making-requests-to-the-api https://developer.oxforddictionaries.com/documentation

Here is my code; trust me that the app id and key are the correct strings.

const url = 'https://od-api.oxforddictionaries.com/api/v1/entries/en/swim';

fetch(url, {
  method: 'GET',
  headers: new Headers({
    'app_id': oxford.appId, 'app_key': oxford.appKey
  }),
}).then(function(response) {
  console.log(response);
});

Comments

  • OK, I found my answer here.

    Looks like this API doesn't support client side requests. I wish this had been clear in the documentation or I could have saved hours racking my brain trying to figure out where I could have gone wrong.

  • jplewjplew Member

    if you're still interested in using the API from the client-side, there are some workarounds. Like for example configuring a proxy server to forward your requests on behalf of your client. Not sure what language you're attempting this with, but it is simple in Angular and Ionic.

  • @jplew any idea how to do this in React? Thanks in advance!

Sign In or Register to comment.