12
Somesh Siripuram • Mihir Kadam Leveraging the new Web API in CRM 2016

Leveraging the new Web API in CRM 2016

Embed Size (px)

Citation preview

Page 1: Leveraging the new Web API in CRM 2016

• Somesh Siripuram• Mihir Kadam

Leveraging the new Web API in CRM 2016

Page 2: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

2

•Web API Introduction • Demo :- Inside CRM Using JavaScript• Demo :- Outside CRM Using JavaScript •Web API Limitations

Agenda

Page 3: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

3

• Framework which makes it easy to build HTTP services• Reaches broad range of clients, including browsers and mobile

devices.• Perform all operations using HTTP request.• Based on OData v4.0 Standard.

Web API Introduction

Page 4: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

4

• Does not required Microsoft Dynamics CRM SDK assemblies. • Access CRM From Inside/Outside Application – Using JavaScript/C#. • Full Support for CRM Online/ On-premises / Internet-facing

deployment (IFD)

Web API in CRM

Page 5: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

5

• Does not require Authentication • Perform Following Operation • CRUD• Action• Bulk• Functions

Inside CRM Using JavaScript

Page 6: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

6

Sample Web API Account Create Request

POST https://cfswebinar.crm5.dynamics.com/api/data/v8.0/accounts HTTP/1.1Accept: application/jsonContent-Type: application/json; type=entryOData-MaxVersion: 4.0OData-Version: 4.0

{"accountnumber":"ACC1","name":"Amazon","websiteurl":"http://amazon.com","address1_city":"NY"

}

Page 7: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

7

Sample Win Opportunity Web API Action request

POST [Organization URI]/api/data/v8.0/WinOpportunity HTTP/1.1Accept: application/jsonContent-Type: application/json; charset=utf-8OData-MaxVersion: 4.0OData-Version: 4.0

{"Status": 3,"OpportunityClose": { "subject": "Won Opportunity", "[email protected]": "[Organization URI]/api/data/v8.0/

opportunities(b3828ac8-917a-e511-80d2-00155d2a68d2)"

} }

Page 8: Leveraging the new Web API in CRM 2016

Outside CRM Using JavaScript

• Required Authentication. • Perform Following Operation

• CRUD• Action• Bulk• Functions

• Prerequisites – CRM Online• Access to Azure Active Directory

Page 9: Leveraging the new Web API in CRM 2016

Web API Authentication from Azure AD

Web Application Get Access Token

HTTP Request CRM

Azure Active Directory

Authenticate

Page 10: Leveraging the new Web API in CRM 2016

Limitation

• GET request will return 5000 records at a time.• When calling actions with entity collection parameters as well as other parameters, a collection parameter must be

passed as the last parameter in the body.• Example :

{ "OverrideorRemove": true, "ListMember": [ { "@odata.type": "Microsoft.Dynamics.CRM.account", "accountid": "483F8080-6976-E511-9172-0024E8436263" }, { "@odata.type": "Microsoft.Dynamics.CRM.account", "accountid": "4D3F8080-6976-E511-9172-0024E8436263" } ]}

Page 11: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

11

Contact Details:

Visit us at www.cloudfronts.com

1. Anil Shah – [email protected]

2. Mihir kadam –[email protected]

3. Someswara Siripuram – [email protected]

Page 12: Leveraging the new Web API in CRM 2016

2015 CloudFronts Technologies LLP, All Rights Reserved.

12