Git Product home page Git Product logo

gettyimages-api_nodejs's People

Contributors

allison-zhao avatar caseymacpherson avatar chrissimmons avatar dependabot[bot] avatar gitter-badger avatar jqyu avatar malsabbagh avatar mapitman avatar ssterli2 avatar tali-ssky avatar wenjieitk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gettyimages-api_nodejs's Issues

Webhook after purchasing?

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.

Bug with adding integers to query param

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.

CORS problem on local

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;
  }
);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.