Check Gmail via API

Hey, all.
I'm working on a flow to check my inbox for new emails from certain domains and notify based on that. I tried the Email node, but it hangs on fetching by IMAP since my inbox has a LOT of messages. I figured using the native Google API would give better control. I found the node @martip/node-red-google-apis, which seems to be working much better, but I am having a hard time figuring out how to pass the userId information to the node. I'm a Node Red noob, but work in IT and am fairly savvy. I'm pretty sure I'm missing something simple here.

[
    {
        "id": "0edb0f715a371ae1",
        "type": "tab",
        "label": "Mail check test",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "5cb654ae71cca214",
        "type": "debug",
        "z": "0edb0f715a371ae1",
        "name": "debug 11",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 680,
        "y": 400,
        "wires": []
    },
    {
        "id": "8b1ba8f87915ae5f",
        "type": "google-apis",
        "z": "0edb0f715a371ae1",
        "name": "List Messages",
        "authentication": "1234123412341234",
        "api": "gmail:v1",
        "method": "users.messages.list",
        "x": 520,
        "y": 400,
        "wires": [
            [
                "5cb654ae71cca214"
            ]
        ]
    },
    {
        "id": "95b8e6687aed3618",
        "type": "inject",
        "z": "0edb0f715a371ae1",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "{\"userId\":\"xxx@xxx.com\"}",
        "payloadType": "json",
        "x": 370,
        "y": 400,
        "wires": [
            [
                "8b1ba8f87915ae5f"
            ]
        ]
    },
    {
        "id": "49622f9b8567887e",
        "type": "google-apis-authentication",
        "name": "Google APIs Authentication",
        "key": "{\n  \"type\": \"service_account\",\n  \"project_id\": \"nodered-ad-notify\",\n  \"private_key_id\": \"1234123412341234123412341234123412341234\",\n  \"private_key\": \"-----BEGIN PRIVATE KEY-----\\nasdfasdfasdfasdfasdfasdfasdfasdf==\\n-----END PRIVATE KEY-----\\n\",\n  \"client_email\": \"nrad-asdf-asdf@nodered-asdf-asdf.iam.gserviceaccount.com\",\n  \"client_id\": \"123412341234123412341\",\n  \"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n  \"token_uri\": \"https://oauth2.googleapis.com/token\",\n  \"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n  \"client_x509_cert_url\": \"https://www.googleapis.com/robot/v1/metadata/x509/nrad-asdf-asdf%40nodered-asdf-asdf.iam.gserviceaccount.com\"\n}\n",
        "scopes": "https://mail.google.com/"
    }
]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.