Giter Site home page Giter Site logo

magento-api-rest's People

Contributors

aaditya avatar oirad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

magento-api-rest's Issues

Can't use in AWS Lambda

Already tried to import magento-api-rest in all known ways.
No matter what I do I keep receiving the response below.

Response
{
  "errorType": "ReferenceError",
  "errorMessage": "Magento is not defined",
  "trace": [
    "ReferenceError: Magento is not defined",
    "    at Runtime.handler (file:///var/task/index.mjs:6:20)",
    "    at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1089:29)"
  ]
}

404 error

Hi, I'm on Magento 1.9 and I'm getting the 404 error.
Here's my request

const Magento = require('magento-api-rest').default;

const client = new Magento({
    'url': '<base_url>/index.php/api/rest', // tried with only <base_url> and <base_url/index.php>
    'consumerKey': '<consumer-key>',
    'consumerSecret': '<secret>',
    'accessToken': '<permanent access token>',
    'tokenSecret': '<token secret>',
});

client.get('/products', {}).then(function (result) {console.log(result)}).catch(function (error) {console.log(error.message)});

PS: I actually need to list all the customers, /customers is giving the same error.
PS: 2... I followed this tutorial https://www.eglobeits.com/blog/how-to-access-magento-rest-and-oAuth-settings-for-rest-api/ to generate oAuth creds... Even here I get 404 in postman in last step, ie.

Method: GET
Url:http://your-url.com/api/rest/products

PS: 3... I didn't setup magento from scratch, instead used a google marketplace installation https://console.cloud.google.com/marketplace/product/miriinfotech-public/magento-31-january-2020?authuser=4&project=apt-cubist-307713

Thanks

Invalid signature error

Hi -

We are encountering signature generation issues using this library. We are on the 2.3.3 M2 codebase with the latest security patch (2.3.3-p1).

Using the code snippet below, the console logs an error, specifically:

'The signature is invalid. Verify and try again.'

const magClient = new MagentoAPI({
  url: 'https://redacted.com',
  consumerKey: 'XXX',
  consumerSecret: 'XXX',
  accessToken: 'XXX',
  tokenSecret: 'XXX',
  // 'magentoVersion': 'V1'
});

magClient
  .get('orders', {})
  .then((response) => {
    console.log(response);
  })
  .catch((error) => {
    console.log(error);
  });

I have switched between SHA1, SHA256, etc to no avail. In your experience, is there anything obvious that may be causing this issue?

TIA

Cannot find module './lib/transform'

H there, I have installed "npm i magento-api-rest" and it didnt install the ./lib/transform folder, any guess what could be wrong?

Thank you,

product update not working without all prefix or store code

Hi there
i have issue on save product update using put

var Magento = require("magento-api-rest").default;
function get_client(store) {
  return new Magento({
    url: store.url,
    consumerKey: store.consumerkey,
    consumerSecret: store.consumersecret,
    accessToken: store.accesstoken,
    tokenSecret: store.tokensecret,
    sha: 256,
  });
}
client
        .put("products/" + product_sku + "/", { product:Product, saveOptions: true })
        .then((res) => {
          console.log(res);
        })
        .catch((e) => {
          console.log(e);
        });

according to some question in stackexchange there should be prefix for this purpose
https://magento.stackexchange.com/questions/164278/update-product-using-rest-api-in-magento-2
https://magento.stackexchange.com/questions/151929/magento-2-update-a-product-name-using-rest-api
how can i add store code or all prefix
thanks in advance

module version: 2.0.4
Magento version: 2.4.3

failed with code 401

I am getting a 401 response and data message of "The signature is invalid. Verify and try again."

const Magento = require('magento-api-rest').default

const client = new Magento({
    'url': 'http://<sitetempurlstring>.mojostratus.io/',
    'consumerKey': '<my integration key>',
    'consumerSecret': '<my integration secret>',
    'accessToken': '<my integration token>',
    'tokenSecret': '<my integration token secret>',
});

async function getOrders () {
  try {
      let { data } = await client.get('products');
      console.log(data)
  } catch (err) {
    console.log('err', err)
  }
}
getOrders()

Any help would be greatly appreciated

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.