Web Services & Web API: URL Formats

Review the URL formats for using web services or web API.

Web Service OData V4 URL Format

Review the following web service OData V4 URL formats for various types of Microsoft Dynamics 365 Business Central environments.

Note icon. Note: In the URL formats, the first part of the URL up to and including the API version is known as the Web Service Endpoint (for example, “https://api.businesscentral.dynamics.com/v2.0/<Tenant>/ODataV4”).

  • In an unnamed cloud environment, the OData V4 URL format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/ODataV4/Company(‘<CompanyName>’)/<ServiceName>

    For example: 
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/ODataV4/Company('CRONUS%20Canada')/GeneralJournals

  • In a named cloud environment, the OData V4 URL format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/<EnvironmentName>/ODataV4/Company(‘<CompanyName>’)/<ServiceName>

    For example:
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/sandbox/ODataV4/Company('CRONUS%20Canada')/GeneralJournals

  • In a single tenant Docker environment, the OData V4 URL format is:

    http://<BaseURL>:<Port>/<ServerInstance>/ODataV4/Company('<CompanyName>')/<ServiceName>

    For example:
    http://api_prod-us-2020-11:7048/BC/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/GeneralJournals

  • In a multi-tenant Docker environment, the OData V4 URL format is:

    http://<BaseURL>:<Port>/<ServerInstance>/ODataV4/Company('<CompanyName>')/ <ServiceName>?tenant=<TenantName>

    For example:
    http://api_prod-us-2020-11:7048/BC/ODataV4/Company('CRONUS%20USA%2C%20Inc.')/GeneralJournals?tenant=default

API URL Format

Review the following web service API URL formats for various types of Microsoft Dynamics 365 Business Central environments.

In the URL formats, <API publisher> and <API group> values are only required when calling third-party extension APIs, such as Binary Stream APIs for Subscription Billing. The values for Subscription Billing APIs are as follows:

  • API publisher for all Binary Stream APIs: binarystream
  • API group for ARCB API: arcb
  • API group for ARED API: ared

For built-in APIs that come with Microsoft Dynamics 365 Business Central, omit the <API publisher> and <API group> values.

Note icon. Note: In the URL formats, the first part of the URL up to and including the API version is known as the API Endpoint (for example, “https://api.businesscentral.dynamics.com/v2.0/<Tenant>/api/<API publisher>/<API group>/<API version>”).

  • In an unnamed cloud environment, the API URL format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/api/<API publisher>/<API group>/<API version>/companies(<Company ID>)/<API Name>

    For example: 
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/api/binarystream/bssiMem/v1.0/companies(9abd98b5-b93c-44c1-bb8c-3bccd73d4bb0)/bssiJournalLines

  • In a named cloud environment, the API URL format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/<EnvironmentName>/api/<API publisher>/<API group>/<API version>/companies(<Company ID>)/<API Name>

    For example:
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/Production/api/binarystream/bssiMem/v1.0/companies(9abd98b5-b93c-44c1-bb8c-3bccd73d4bb0)/bssiJournalLines

  • In a single tenant Docker environment, the API URL format is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API publisher>/<API group>/<API version>/companies(<Company ID>)/<API Name>

    For example:
    http://api_prod-us-2020-11:7048/BC/api/binarystream/bssiMem/v1.0/companies(6a3b4860-0515-eb11-bb49-000d3a492075)/bssiJournalLines

  • In a multi-tenant Docker environment, the API URL format is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API publisher>/<API group>/<API version>/companies(<Company ID>)/<API Name>/?tenant=<TenantName>

    For example:
    http://api_prod-us-2020-11:7048/BC/api/binarystream/bssiMem/v1.0/companies(6a3b4860-0515-eb11-bb49-000d3a492075)/bssiJournalLines/?tenant=default

Tenant ID for Web API URLs

For multi-tenant environments in the cloud or on Docker, the Tenant ID must be included in the web API URL formats.

Note icon. Note: For web services, the Tenant ID is automatically included the URL that Microsoft Dynamics 365 Business Central creates when a web service is published on the Web Services page in Microsoft Dynamics 365 Business Central.

Use one of the following methods to determine the Tenant ID in the cloud.

  • When logging on to the cloud environment, the Tenant ID is integrated with the URL (as highlighted in the following image).

  • The Tenant ID appears on the Help and Support page, which you access by selecting the Help icon (as highlighted in the following image).

To determine the Tenant ID in a multi-tenant Docker environment, use the PowerShell command:
Get-BcContainerTenants -containerName <ContainerName>.

The Tenant ID is highlighted in the following image.

Company ID for Web API URLs

The Company ID must be included in the web API URL formats. To get the list of Company IDs for your environment, execute the built-in companies API using the HTTP GET method. The API URL format for executing the companies API depends on the type of environment you are using.

Note icon. Note: For web services, the Company ID is automatically included the URL that Microsoft Dynamics 365 Business Central creates when a web service is published on the Web Services page in Microsoft Dynamics 365 Business Central.

  • In an unnamed cloud environment, the API URL format to get the list of Company IDs is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/api/<API version>/companies

    For example: 
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/api/v2.0/companies

  • In a named cloud environment, the API URL format to get the list of Company IDs is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/<EnvironmentName >/api/<API version>/companies

    For example:
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/Production/api/v2.0/companies

  • In a single tenant Docker environment, the API URL format to get the list of Company IDs is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API version>/companies

    For example:
    http://api_prod-us-2020-11:7048/BC/api/v2.0/companies

  • In a multi-tenant Docker environment, the API URL format to get the list of Company IDs is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API version>/companies/?tenant=<TenantName>

    For example:
    http://api_prod-us-2020-11:7048/BC/api/v2.0/companies/?tenant=default

The following example demonstrates the use of Postman to execute the companies API in a named cloud environment. The returned Company ID is highlighted in the image:

Get List of Web API Names

To get the list of API names that you can use in your environment, execute the API URL endpoint using the HTTP GET method. The API URL endpoint format depends on the type of environment you are using.

Note icon. Note: In the following URL formats, <API publisher> and <API group> values are only required when calling extension APIs such as the Binary Stream APIs for Subscription Billing. The values for Subscription Billing are:

  • API publisher: binarystream
  • API group: bssiApi

For built-in APIs that come with Microsoft Dynamics 365 Business Central, omit the <API publisher> and <API group> values.

  • In an unnamed cloud environment, the API URL endpoint format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/api/<API publisher>/<API group>/<API version>

    For example: 
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/api/binarystream/bssiApi/v1.0

  • In a named cloud environment, the API URL endpoint format is:

    https://api.businesscentral.dynamics.com/v2.0/<Tenant>/<EnvironmentName>/api/<API publisher>/<API group>/<API version>

    For example:
    https://api.businesscentral.dynamics.com/v2.0/dd24e63d-2131-4bd0-bdd5-570c473ba440/Production/api/binarystream/bssiApi/v1.0

  • In a single tenant Docker environment, the API URL endpoint format is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API publisher>/<API group>/<API version>

    For example:
    http://mem-us-2020-11:7048/BC/api/binarystream/bssiApi/v1.0

  • In a multi-tenant Docker environment, the API URL endpoint format is:

    http://<BaseURL>:<Port>/<ServerInstance>/api/<API publisher>/<API group>/<API version>/?tenant=<TenantName>

    For example:
    http://mem-us-2020-11:7048/BC/api/binarystream/bssiApi/v1.0/?tenant=default

The following example demonstrates the use of Postman to get the list of API names for Microsoft Dynamics 365 Business Central's web API in a named cloud environment. The returned API names are highlighted in the image: