最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

node.js - Issue with Postmaster Tools API - "Requested entity was not found" - Stack Overflow

programmeradmin8浏览0评论

We are currently implementing the Postmaster Tools API using the Google API SDK for NodeJS. Our intended workflow involves a user authenticating through our portal, followed by an OAuth-driven API call to retrieve a list of their domains. Subsequently, for each domain to which the user has access, we aim to fetch traffic details.

Following the provided code snippet, we are successfully retrieving the domain list:

const gmailpostmaster = google.gmailpostmastertools({
  version: "v1",
  auth: oAuth2Client,
});

const domains = await gmailpostmaster.domains.list();

// domains.data returns:
{
  domains: [{
    "name": "domains/example",
    "createTime": "2025-02-03T06:45:04Z",
    "permission": "OWNER"
  }]
}

However, when attempting to retrieve traffic statistics for a specific domain using the following code:

const details = await gmailpostmaster.domains.trafficStats.list({
  parent: "domains/example",
});

We encounter a "Requested entity was not found" error:

{
  message: 'Requested entity was not found.',
  domain: 'global',
  reason: 'notFound'
}

Interestingly, this issue persists even when utilizing the API Playground on the Google Developers website ().

Could you please assist in identifying any missing configurations or potential errors on our end that might be causing this issue?

Strangely, the Google Postmaster Dashboard Shows the data but fails.

Our environment details are as follows:

  • Node.js version: 22.9.0
  • Google APIs SDK version: [email protected]
  • oAuth Scope: .readonly

Thank you for your time and support.

The SDK Should return the traffic details for the available dates

发布评论

评论列表(0)

  1. 暂无评论