0.1.3 • Published 3 years ago

amocrm-api-nodejs v0.1.3

Weekly downloads
15
License
MIT
Repository
github
Last release
3 years ago

Amocrm APIs Node.js Client

Create client index.ts

import { Amocrm } from "amocrm-api-nodejs";

const client = new Amocrm.Api({
  tokenResolver(): Promise<string> {
    const token = getAccessToken();
    return Promise.resolve(token.access_token);
  },
  domain: process.env.AMO_DOMAIN,
  client_secret: process.env.AMO_CLIENT_SECRET || '',
  client_id: process.env.AMO_CLIENT_ID || '',
  redirect_uri: process.env.AMO_REDIRECT_URL || '',
  code: process.env.AMO_CODE || '',
});

(async function() {
    try {
      const responseAccount = await client.account.with(['users', 'task_types', 'pipelines', 'note_types', 'groups', 'custom_fields']);
      console.dir(responseAccount, {depth: 10, colors: true})

    } catch (error) {
      console.dir(error, {depth:11, colors: true});
    }
})();
0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago