Can't get Google Photos API to work in HTTP Request node with OAuth2

Sorry if this is a stupid question, but I’ve been trying to get the API for Google Photos to work within n8n. I’m getting this error, and can’t figure out what is wrong.

I don’t think the Credential is the problem, because it asks me for the right permissions when authenticating and doesn’t seem to throw any errors itself.

Any help is very appreciated, thank you in advance :slight_smile:

Hi @ConfusedAnt, so I gave this a go on my end and could fetch my media items using the GET https://photoslibrary.googleapis.com/v1/mediaItems endpoint:

Example Workflow
{
  "nodes": [
    {
      "parameters": {
        "authentication": "oAuth2",
        "url": "https://photoslibrary.googleapis.com/v1/mediaItems",
        "options": {
          "fullResponse": false,
          "splitIntoItems": false
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "credentials": {
        "oAuth2Api": {
          "id": "76",
          "name": "Google Photos Library"
        }
      }
    },
    {
      "parameters": {},
      "name": "Start",
      "type": "n8n-nodes-base.start",
      "typeVersion": 1,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "authentication": "oAuth2",
        "url": "https://photoslibrary.googleapis.com/v1/mediaItems",
        "options": {
          "fullResponse": false,
          "splitIntoItems": false
        }
      },
      "name": "HTTP Request",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 1,
      "position": [
        460,
        300
      ],
      "credentials": {
        "oAuth2Api": {
          "id": "76",
          "name": "Google Photos Library"
        }
      }
    },
    {
      "parameters": {
        "fieldToSplitOut": "mediaItems",
        "options": {}
      },
      "name": "Item Lists",
      "type": "n8n-nodes-base.itemLists",
      "typeVersion": 1,
      "position": [
        680,
        300
      ]
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Item Lists",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Start": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

To set up the credentials, I have used these settings in n8n:


I noticed you have a different access token URL - I am using https://oauth2.googleapis.com/token found here.

I’ve also added these scopes: https://www.googleapis.com/auth/photoslibrary https://www.googleapis.com/auth/photoslibrary.sharing https://www.googleapis.com/auth/photoslibrary.edit.appcreateddata and access_type=offline as the query parameter.

Maybe you can give this a go on your end and see if any of these does the trick?

1 Like

thank you so much. my Access Token URL was the problem, changing it to the one you are using fixed the issue

1 Like

Hey @Lellis,

Are you seeing the same issue? It would be worth making a new post so you don’t reopen a solved issue with a different request.