googleapis / googleapis/google-api-nodejs-client

Keep api

Aperta
#3,320 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
priority: p3 type: question
Lingua principale
TypeScript
Stelle
12.2k
Fork
2k
Merge medio
1g 9h
PR unite (30g)
24

Descrizione

this is what i’m trying (see code below), received 200 but no data in the body, if i well understood if i don’t send nothing as a get parameters the default json that i received back show the trash folder of keep notes - that was not empty.

there aren’t any example for nodejs except java and REST - I also tried calendar api with same token logic but it doesn’t work, in this last case i received 400 with localhost:80 error.

My goal is to fetch all keep notes as a list (as described in the documentation).

Thanks

const { google } = require("googleapis");

const axios = require('axios');

start()

async function start () {

const auth = new google.auth.GoogleAuth({
keyFile: "account_key.json",
scopes: [
"https://www.googleapis.com/auth/keep"
],
// 'online' (default) or 'offline' (gets refresh_token)
access_type: 'offline',
include_granted_scopes: true
});

const url = "https://keep.googleapis.com/v1/notes?pageSize=10"

const token = await auth.getAccessToken()

console.log(token)

axios.request({
url,
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Accept-Encoding': 'application/json',
Authorization: `Bearer ${token}`
},
})
.then(response => {
console.log(response.data)
})
.catch(err => {
console.log('err :', err);
});
}

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia con la richiesta list-notes di Keep API nell’issue e confronta la relativa configurazione OAuth e i parametri scope, token e pageSize con la documentazione di Keep API. Riproduci la richiesta Node.js e determina perché non restituisce dati sulle note; il lavoro è completato quando l’esempio recupera le note Keep dell’utente oppure segnala chiaramente la limitazione dell’API o l’autorizzazione richiesta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, node.js, typescript
Ambito
api, backend
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
20/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.