You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when using this library, samme call with curl works fine
Environment details
OS: 5.3.7-arch1-1-ARCH
Node.js version: v10.16.3
npm version: 6.12.0
googleapis version: 44.0.0
Steps to reproduce
Copy paste your simplest example of fetching info about a blog with a large number, ie mine is 7734453256887931626
const{google}=require('googleapis');constblogger=google.blogger({version: 'v3',auth: 'XXX'});constmain=async()=>{constres=awaitblogger.blogs.get({blogId: 734453256887931626});console.log(`${res.data.name} has ${res.data.posts.totalItems} posts! The blog url is ${res.data.url}`);};main().catch(console.error);
Inspect with VsCode or something, you will get 404 and you will find the url that is called, and the blogId is now 7734453256887932000
The text was updated successfully, but these errors were encountered:
bcoe
added
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
priority: p2
Moderately-important priority. Fix may not be included in next release.
external
This issue is blocked on a bug with the actual product.
and removed
triage me
I really want to be triaged.
labels
Oct 22, 2019
JustinBeckwith
added
type: docs
Improvement to the documentation for an API.
and removed
external
This issue is blocked on a bug with the actual product.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
labels
Dec 3, 2019
So I think I know what's happening. The type of blogId here should be a string. 734453256887931626 is too big to be represented by by a JavaScript integer!
The fix is to wrap the blogId in quotes to make it a string:
const{google}=require('googleapis');constblogger=google.blogger({version: 'v3',auth: 'XXX'});constmain=async()=>{constres=awaitblogger.blogs.get({blogId: '734453256887931626'});console.log(`${res.data.name} has ${res.data.posts.totalItems} posts! The blog url is ${res.data.url}`);};main().catch(console.error);
TLDR
blogId 7734453256887931626 becomes
blogId 7734453256887932000
when using this library, samme call with curl works fine
Environment details
googleapis
version: 44.0.0Steps to reproduce
The text was updated successfully, but these errors were encountered: