domoinc / domo-node-sdk Goto Github PK
View Code? Open in Web Editor NEWNodeJS - Domo API SDK
Home Page: https://developer.domo.com
License: MIT License
NodeJS - Domo API SDK
Home Page: https://developer.domo.com
License: MIT License
domo.datasets.get(datasetId)
.then(res => { console.log(\nDataset: ${res.id} - ${res.name}
); })
.catch(console.error);
The method above seems to have a bug. I am trying to get data from domo with the right credentials.
I am able to get this data successfully in Postman by using the url:
https://api.domo.com/v1/datasets/{DATASET_ID}/data
with the right authentication as well
However when I use the method above, I get the error which I've summarized as follows:
{
"status": 400,
"statusReason": "Bad Request",
"message": "Infrastructure problem (403): Access is denied",
"toe": "DV3ET85U1V-GQ837-V5TN9"
}
I am sure this is because in your sdk you do not concated "data" to the url i.e.
https://api.domo.com/v1/datasets/{DATASET_ID}/
I tried it postman and got the same error the method throws.
I've tried to manually add the "/data" to the url in the sdk but it still does not work.
Thanks
the json parameter in options which is passed down to the request-promise-native call should be absent or set to false when requesting data
The transport client will intercept any response and retry any request that failed for a 401. This is meant to catch requests where the oauth token has expired, refresh the token, and then resend the original request.
Looks like sometimes the API will return a 406 if the token wasn't been set. Needs more investigation.
I'm getting the following error when attempting to call .datasets.list:
{ Error: Unable to GET /v1/datasets for Dataset at RequestException (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Errors.js:5:9) at request.catch (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Transport.js:20:24) at process._tickCallback (internal/process/next_tick.js:109:7) method: 'GET', type: 'Dataset', path: '/v1/datasets', error: TypeError: Constants_1.API_SCOPE[s].toLowerCase is not a function at scope.scopes.map.s (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Transport.js:76:46) at Array.map (native) at Transport.renewAccessToken (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Transport.js:72:14) at Transport.retryRequest (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Transport.js:105:25) at rp.catch.err (/Users/sethstradling/Documents/Development/cerberus/node_modules/domo-sdk/dist/common/Transport.js:101:32) at process._tickCallback (internal/process/next_tick.js:109:7) }
It appears that when Transport.js is processing/mapping scopes, the generated constants.API_SCOPE looks like:
{ '0': 'USER', '1': 'DATA', USER: 0, DATA: 1 }
,
and since I'm passing 'USER', the function is attempting to pass 0 to .toLowerCase().
Not sure why API_SCOPE is getting interpreted that way.
The following code produces an infinite loop:
const domo = require('domo-sdk');
const domoClient = new domo.DomoClient('foo', 'bar');
domoClient.streams.createExecution('19').then((res) => {
// Never gets here
done();
}).catch((err) => {
// Never gets here either
done(err);
});
The logs will print the following:
GET: https://api.domo.com/oauth/token
OAuth token has likely expired. Renewing and attempting again
Renewing access token for scopes: "user data"
When importing data using domo.dataset.importData()
I end up overwriting the contents of my dataset rather than appending to it as I would prefer. This documentation suggests that the ?updateMethod
query parameter should be set to APPEND
for the underlying API request. Please consider adding a parameter to importData()
to select the append semantic, or perhaps add a function like domo.datasets.appendData()
that may be used instead of importData()
when appending is desired.
Hello all,
thanks for the great library.
I've notived since v2.0 the signature for domo.streams.create has change from:
domo.streams.create(dataset, updatemethod)
to one parameter:
domo.streams.create({dataSet: dataset, updateMethod: 'REPLACE'})
just a heads up if anyone else runs into this.
regards
Simon
The examples need to be finished and the README doc references are broken
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.