gettyimages / gettyimages-api_nodejs Goto Github PK
View Code? Open in Web Editor NEWGetty Images API SDK for Node.js
Home Page: https://developers.gettyimages.com/
License: MIT License
Getty Images API SDK for Node.js
Home Page: https://developers.gettyimages.com/
License: MIT License
Hi guys, I'd need to automatically download an image after each purchase by using sdk. Is there a webhook I can use to notify my local project that he can run download proccess? Thanks.
I was using withPage()
and withPageSize()
to get a paginated response but it didn't work, so I looked more into the code and found out that there is this check (https://github.com/gettyimages/gettyimages-api_nodejs/blob/master/lib/searchimageseditorial.js#L202)
function addParameter(params, key, value) {
if (value && value.length > 0) {
if (value.constructor === Array) {
params[key] = value.join(",");
} else {
params[key] = value;
}
}
}
When an integer is passed in value
instead of a string, this check fails and later fails to add this param to the query. I was also misled by the wrong examples in README (withPage
and withPageSize
were both called with an integer) and the initialization using integers, for example, page
and pageSize
https://github.com/gettyimages/gettyimages-api_nodejs/blob/master/lib/searchimageseditorial.js#L32
I've added a pull request to account for this scenario and save users much time in debugging.
Hi, is there a functio nthat returns user count downloads?? Or I should doi ity separately with axios? Thanks.
Why can't I use safe_search here? Can you please add support for this?
like a new method - withSafeSearch(val)
Hi, I tried to implement the library but I have this issue with he requests.
Error message:
No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
My code:
import config from "../env";
var api = require("gettyimages-api");
var creds = {
apiKey: config.GETTY_API_KEY,
apiSecret: config.GETTY_API_SECRET,
username: "myemail",
password: "mypassword",
};
const gettyApi = new api(creds);
gettyApi.getAccessToken().then(
(response) => {
console.log(response.access_token);
},
(err) => {
throw err;
}
);
https://github.com/gettyimages/gettyimages-api_nodejs/blob/main/lib/searchimagescreative.js#L186
When a parameter is a boolean, it fails the .length
check on the line referenced above.
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.