Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

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
fcb1a4b

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 

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