node-dcrm-service
TypeScript icon, indicating that this package has built-in type declarations

3.1.4 • Public • Published

DynamicsCrm-NodeCrmService

Join the chat at https://gitter.im/yagasoft/DynamicsCrm-NodeCrmService

Version: 3.1.4


Easily authenticate with Dynamics CRM built-in services from a Node app.

Usage

Imports

import { ICrmService, CrmService, CrmResponse, CrmConnectionConfig, CrmO365ConnectionConfig, CrmAdConnectionConfig } from "node-dcrm-service";

Code

const parameters =
   {
      baseUrl: "https://testorg.crm.dynamics.com",
      webApiHost: "testorg.api.crm.dynamics.com",
      tenant: "testorg.onmicrosoft.com",
      apiVersion: "8.2",
      username: "testuser@testorg.onmicrosoft.com",
      password: "password",
      appId: "16cd08d5-b6f1-475e-90a3-d40d83e26bbc",
      clientId: "Ao+cz9J6MNe/tyizLZR5ili3Oth/vBoZzTr5DqS6r+o="
   }
onlineConfig = new CrmO365ConnectionConfig(parameters);
onlineCrmService = new CrmService(onlineConfig);
await onlineCrmService.initialise();
const whoAmIResponse = await onlineCrmService.get("WhoAmI()");
console.log(whoAmIResponse.body.UserId)));

Additional info

Steps to getting a Client ID

Wiki Page

Article

The following blog post explains this library in a bit more detail: link.

Changes

v3.1.4 (2018-09-12)

  • Added: exposed the CrmService interface
  • Added: append /api/data/v8.2/ URL prefix by default
  • Added: parameterised the Web API service version
  • Improved: internally switched to async/await instead of explicit promises
  • Fixed: undefined error when request fails

v2.1.3 (2018-08-27)

  • Improved: switched to 'request' library to improve response handling
  • Improved: wrapped the response into a new class for type checking
  • Fixed: standardised response/error object

v1.1.8 (2018-08-26)

  • Added: 'data' parameter to post, put, and patch
  • Changed: exposed CrmConnectionConfig to be used for polymorphism

v1.1.6 (2018-08-26)

  • Added: example code
  • Added: Wiki entry for getting a Client ID
  • Removed: Node package dependency

v1.1.5 (2018-08-24)

  • Fixed: packaging issues

v1.1.2 (2018-08-23)

  • Initial release

Copyright © by Ahmed el-Sawalhy (Yagasoft) -- GPL v3 Licence

Package Sidebar

Install

npm i node-dcrm-service

Weekly Downloads

2

Version

3.1.4

License

GPL-3.0

Unpacked Size

105 kB

Total Files

54

Last publish

Collaborators

  • yaganox