Reputation: 1
I have a Google sheet that I have to get options for my custom select from. I need to do it from Shopify client. As I understood from docs i need to make follow:
function initClient() {
return gapi.auth2.init({client_id: CLIENT_ID});
}
function authenticate() {
return gapi.auth2.getAuthInstance().signIn();
}
function loadClient() {
return gapi.client.load("https://sheets.googleapis.com/$discovery/rest?version=v4");
}
function execute() {
return gapi.client.sheets.spreadsheets.values.get({
"spreadsheetId": spreadsheetId,
"range": range
});
}
gapi.load("client:auth2", function() {
initClient().then(authenticate).then(loadClient).then(execute).then(function(response) {
// Обработка полученных данных
console.log("Response", response);
}).catch(function(error) {
console.error("Error", error);
});
});
But it answers
"You have created a new client application that uses libraries for user authentication or authorization that are deprecated. New clients must use the new libraries instead. See the Migration Guide for more information."
It has some info what was changed but witthout any examples. And now I get stuck with my task.
How to make right according to new API rules
Upvotes: 0
Views: 39