--- title: "How Do I Retrieve Information from FO via OData Request?" slug: "how-do-i-retrieve-information-from-fo-via-odata-request" description: "This article shows how to retrieve data from FO via an OData request from the FO API. We will request the Vendor list from All companies." tags: ["Finance and Operations", "Lasernet FO Connector", "Microsoft Entra ID", "App registration", "Lasernet Developer", "API", "Client", "OData"] updated: 2026-03-02T16:36:55Z published: 2026-03-02T16:36:55Z canonical: "kb.lasernetgroup.com/how-do-i-retrieve-information-from-fo-via-odata-request" --- > ## Documentation Index > Fetch the complete documentation index at: https://kb.lasernetgroup.com/llms.txt > Use this file to discover all available pages before exploring further. # How Do I Retrieve Information from Finance and Operations via OData Request? This article explains how to retrieve data from Finance and Operations via an OData request from the FO API. In this example, the **Vendor list** will be requested from **All companies**. ## Create an API Registration The first step is to create an App Registration in your Azure environment. This must be done in the same Azure Tenant as your FO virtual host. Follow these steps: 1. Log in to your Azure portal and open the Microsoft Entra ID. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-T8F7MXSG.png) 1. Select **App registrations** from the left-hand side menu and then **New registration** from the top menu. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-9LGWHBZL.png) 1. Fill in the **Name** field for the new app, select an appropriate type from the **Supported account types**, and then click **Register** at the bottom of the screen. 2. In **API permissions**, select **Add a permission**, then choose **Dynamics ERP**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-2LAHI13L.png) 1. Click **Delegated permissions** and add all three options, then click **Add permissions**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-3YGEMAQI.png) ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-FQXQQ684.png) 1. Select **Certificates & secrets** from the left-hand side menu and then **New client secret**. 2. Type in a **Description**, select **Never**, and then click **Add**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-75COLNRN.png) 1. Copy the code and add it to a text editor such as Notepad. You will need the code later, as we cannot read it again when you close the form. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-X5IG1MLP.png) 1. Select **Overview** from the left-hand side menu and copy the **Application (Client) ID** and the **Directory (tenant) ID** into your Notepad with the **Client secret**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-5SSWKXCX.png) ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-RUK31Y99.png) 1. Log in to your FO environment with admin rights and navigate to **System administration** > **Setup** > **Microsoft Entra ID applications**. 2. Click **New** on the Action pane and copy the **Client ID** from your Notepad. Give it a name and add a **User** for the app to run as. > [!NOTE] > Info > > Think about what permissions that user has. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-99OF3YA6.png) ## Build the Connection To establish the connection to the App Registration in your Lasernet setup, you need a token. Follow these steps: 1. Open your Lasernet configuration, select **Modifiers**, add an **HTTP modifier**, and give it a name. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-BEYF1VU1.png) 1. Open the **Setup** tab. In the **Direction** field, select the **Output** radio button, and in the **Verb** field, click the **POST** radio button. 2. Add a **Host** and a **Remote path**. The **Remote path** should include your **Directory (tenant) ID**. Copy it from your Notepad. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-1IZVD11D.png) 1. Open the **Parameters** tab and add the following four parameters: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-1U44HGUC.png) - **client_id**: Your App Registration’s ID (copy from your Notepad). - **client_secret**: Your Client secret ID (copy from your Notepad). - **grant_type**: client_credentials. - **resource**: The URL to Dynamics 365 Finance and Operations. 1. Open the **Headers** tab and add the following: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-AF0ZJ44N.png) **Content-Type**: `application/x-www-form-urlencoded` 1. Click **Ok** to close the form, open the **HTTP modifier** again, and click **Run** from the top menu. You should get a positive response. In the **Log** window, scroll all the way down to the last line, right-click the line, and select **Preview**. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-EA850QOA.png) 1. Check that you got a **Token**. If you did not get a **Token**, you need to double-check IDs. 2. Close the form and the **HTTP modifier**. 3. Add a new **HTTP modifier** and give it a name. 4. Open the **Setup** tab. In the **Direction** field, click the **Output** radio button, and in the **Verb** field, click the **GET** radio button. 5. Add a **Host** and a **Remote path**. The **Remote path** should contain `) }}?cross-company=true` if you wish to get data across all companies. > [!NOTE] > Note > > The following image illustrates how it works now, but Microsoft will likely change this in the future. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-31LW5YZN.png) - **Host**: Your Dynamics 365 Finance and Operations URL - **Remote path**: `/data/"Entityname"?cross-company=true` 1. Open the **Headers** tab and add the following: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-J23DXT7W.png) **Authorization**: `Bearer #BearerToken#` (this JobInfo will be created from a script that we are adding later). 1. Click **Ok** to close the form. 2. Select **Modules** from the left-hand side menu. 3. Add a **Scheduler** module and give it a name. 4. Open the **Exit Modifiers** tab and add the following modifiers in the same order: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-0VOMJEJ7.png) 1. After these modifiers are added, click **Add** again, click **Script**, and then **Edit**. 2. Add the following script (the script is extracting the access **Token** from the response): ```javascript function extractToken() { //Add the response into a variable var response = job.getJobInfo("OAuthResponse"); //Parse the response variable as JSON var json = JSON.parse(response); if (json !== '' && json !== '{}' && json.access_token !== '') { job.setJobInfo("BearerToken", json.access_token, true); } else { job.setJobInfo("BearerToken", "", true); } } extractToken(); ``` ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-73WM5SN2.png) 1. Save, close the script, and click **Ok** to close the **Modifier** form. 2. Move the script modifier so it is placed between the two other modifiers. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-5LJG5CRZ.png) 1. Open the **Setup** tab, set a time for the scheduler to execute, and then close the scheduler form. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-MFGO3CG5.png) 1. Add a **File Output** module or another output module where you want your `JSON` file. Add that destination to your scheduler and update the Lasernet service. You are ready to go. ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-02DU738B.png) This is a sample of the output: ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-MBUMSEGM.png) ![](https://cdn.document360.io/c831ef63-c6b3-48ee-b443-3e33644e4e2e/Images/Documentation/image-4SFEK8WD.png)