googleapis / googleapis/google-api-nodejs-client

Keep api

Offen
#3,320 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
priority: p3 type: question
Vorherrschende Sprache
TypeScript
Sterne
12.2k
Forks
2k
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
24

Beschreibung

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);
});
}

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit der Keep API list-notes-Anfrage im Issue und vergleiche deren OAuth-Einrichtung, scope-, token- und pageSize-Parameter mit der Dokumentation der Keep API. Reproduziere die Node.js-Anfrage und ermittle, warum sie keine Notizdaten zurückgibt; als erledigt gilt die Aufgabe, wenn das Beispiel die Keep-Notizen des Benutzers abruft oder die API-Einschränkung bzw. die erforderliche Autorisierung eindeutig meldet.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js, typescript
Bereich
api, backend
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
20/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.