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
I'm getting many 'x' is not a function when trying to invoke the functions listed in the API docs here:
This is the file I used to test this:
var ForgeSDK = require('forge-apis');
var CLIENT_ID = 'myid...' , CLIENT_SECRET = 'mysecret...', REDIRECT_URL = 'http://localhost:3000';
var autoRefresh = true;
var oAuth2TwoLegged = new ForgeSDK.AuthClientTwoLegged(CLIENT_ID, CLIENT_SECRET, [
'data:read',
'data:write'
], autoRefresh);
var oAuth2ThreeLegged = new ForgeSDK.AuthClientThreeLegged(CLIENT_ID, CLIENT_SECRET, REDIRECT_URL, [
'data:read',
'data:write'
], autoRefresh);
var str2leg = 'saved credentials string';
var str3leg = 'other saved credentials string';
var TwoLeggedCredentials = JSON.parse(str2leg);
var ThreeLeggedCredentials = JSON.parse(str3leg);
console.log(ForgeSDK.BucketsApi.getBuckets(oAuth2TwoLegged, TwoLeggedCredentials));
And I got that getBuckets is not a function.
Then I tried to load that same file to a node shell and run the following commands to test more functions, nothing seemed to work.
I couldn't find any of the functions listed in the docs when I tried to explore the ForgeSDK object...
> console.log(Object.getOwnPropertyNames(ForgeSDK.Buckets));
[ 'length', 'name', 'prototype', 'constructFromObject' ]
undefined
> var x = new ForgeSDK.Buckets
undefined
> console.log(x);
exports { items: undefined, next: undefined }
undefined
> console.log(Object.getOwnPropertyNames(x));
[ 'items', 'next' ]
undefined
> console.log(Object.getOwnPropertyNames(x.items));
TypeError: Cannot convert undefined or null to object
> console.log(ForgeSDK.Buckets);
{ [Function: exports] constructFromObject: [Function: constructFromObject] }
undefined
> console.log(ForgeSDK.Buckets.items);
undefined
> ForgeSDK.AppPackagesApi.getUploadUrl()
TypeError: ForgeSDK.AppPackagesApi.getUploadUrl is not a function
I'm probably not doing it right, can you please give an example on how to use the api functions?
PS: of course I use the right id, secret and credentials.
The text was updated successfully, but these errors were encountered:
I'm getting many 'x' is not a function when trying to invoke the functions listed in the API docs here:
This is the file I used to test this:
And I got that
getBuckets
is not a function.Then I tried to load that same file to a node shell and run the following commands to test more functions, nothing seemed to work.
I couldn't find any of the functions listed in the docs when I tried to explore the
ForgeSDK
object...I'm probably not doing it right, can you please give an example on how to use the api functions?
PS: of course I use the right id, secret and credentials.
The text was updated successfully, but these errors were encountered: