# Microsoft Dynamics 365

### Introduction

* There are [three ways to connect](https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/web-services) to web services: API, SOAP, and OData
* [OData overview video](https://www.youtube.com/watch?v=Iwh-AgJ4uF4)

{% hint style="info" %}
By default, Locoia's connector connects to the regular Microsoft Dynamics 365 Business Central **API**.
{% endhint %}

### Authentication

To authenticate, your users need to have the correct level of access. You may need to request an additional access level from your system admin.

### OData

To get to the OData settings, click on the search icon in the upper left corner and type `web services` and click on the `> Web Services` :

![Web Services](https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FJZCxXZeZfeQ8IVEQ9Bi4%2Fimage.png?alt=media\&token=b0fbf4f3-6d1c-464e-a8ed-e881a871cefb)

To get the Username and Password for the OData services, go to Users, select a user and get the key from `Web Service Access Key`. The Username corresponds to the user's name.

#### Adding a new an OData services

E.g. to add a new oData service for **Sales Line Item Discounts**,&#x20;

1. go to the corresponding view in Business Central
2. get the page id from the URL as per the image below
3. Go to the **web service view**
4. Click **New**
5. As **Object Type**, select page
6. Click in the **Object ID** field and then a window pops up
7. Select in the **bottom right** of the window **Select from full** **list,** and the window enlarges
8. In the newly enlarged window, click the **search icon**, type the page ID, e.g. 7004
9. The Sales Line Item Discounts show up. Select it
10. Give the service a **name** without spaces
11. Make the final selections and you are done

The page and its objects are now available as OData service.

![](https://291121471-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-McrRFZHYH27bqKzOVDd%2Fuploads%2FURNjJpDCQ2CvdNlKwUjp%2Fimage.png?alt=media\&token=72597ae3-3998-44e1-a0bb-c96ff2b47fde)
