Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Using API key to retrieve data

Discussion in 'Localization Tools' started by cheese_block, Nov 26, 2020.

  1. cheese_block

    cheese_block

    Joined:
    Aug 22, 2017
    Posts:
    51
    Hi,

    Just getting started with localisation package. I've set up a google spreadsheet, made it public and set up an API key. Added the details into the Google Sheets Service then set up a string table collection. I can connected to the spreadsheet as it will list the sheets. But if I try a Pull request it errors saying:

    "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential."

    I thought that simply reading from the sheet is possible with an API key as long as it's public, is that correct? Might I be doing anything else wrong?

    Thanks
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,787
    Yes it should be possible to pull with just an API Key. I have just tried it myself and I'm also having the same problems. Not sure why it would allow you to pull some data (sheet names) but not the contents.
    It looks like it may be because we are using a data filter to get the sheet data.

    Could you file a bug report?

    If you can use an OAuth tokten then that should work for you now.
     
    Last edited: Nov 26, 2020
  3. cheese_block

    cheese_block

    Joined:
    Aug 22, 2017
    Posts:
    51
    karl_jones likes this.
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,787
    Yeah I did the same :)
    GetData does work though so we should be fine.
    I think it needs to have the scope `https://www.googleapis.com/auth/spreadsheets.readonly` to work.
     
  5. cheese_block

    cheese_block

    Joined:
    Aug 22, 2017
    Posts:
    51
    Any idea when there might be an update on this? Thanks
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,787
    We will likely need to change it to use GetData instead of the filter version. Our next release won't be until early January now so thats the earliest a fix would be available.
     
    cheese_block likes this.