web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Unanswered

Integrate Business Central with Dynamics CRM using API's

(0) ShareShare
ReportReport
Posted on by 266

Hi All,

Is there a way to consume third party API's in Business Central. If Yes can anyone help to provide the step by step process to do the same. Also, if any reference links available can share those as well.

Please also note we don't want to use any Paid connectors or third party integration websites. We want to develop the integration at Business Central.

Quick replies will be appreciated. 

Thanks in advance!!

  • Muhammad Arif Maseed Profile Picture
    795 on at

    Hi, There is a default connector available for Business Central and dynamics CRM connection and this standard connector are completly free. Anyhow if you want to develop your own functionality below is the code to consume API's in Business Central.

    procedure GetInvoices()

       var

           AssignmentsArr: JsonArray;

           AssignmentCount: integer;

           i: integer;

           DocumentType: Text;

           ResponseText: Text;

           contentHeaders: HttpHeaders;

           ResponseMessage: HttpResponseMessage;

           vHttpRequestMessage: HttpRequestMessage;

           JsonObj: JsonObject;

           JsonTok: JsonToken;

           Client: HttpClient;

       begin

           vHttpRequestMessage.GetHeaders(contentHeaders);

           contentHeaders.Clear();

           FakturaBoksSetup.Get();

           uri := FB."Base URL" + 'api/NavBc/GetData/?CompanyCode=' + FB."Company Name";

           vHttpRequestMessage.Method := 'GET';

           contentHeaders.Add('Authorization', CreateBasicAuthHeader());

           contentHeaders.Add('API_KEY', FakturaBoksSetup."Access Key");

           vHttpRequestMessage.SetRequestUri(uri);

           client.Send(vHttpRequestMessage, ResponseMessage);

           ResponseMessage.Content().ReadAs(responseText);

           JsonTok.ReadFrom(ResponseText);

           if ResponseText = '' then

               Message('Nothing to Import');

           if jsonTok.IsArray then begin

               AssignmentsArr := jsonTok.AsArray();

               AssignmentCount := AssignmentsArr.Count();

               for i := 0 to AssignmentCount - 1 do begin

                   IF AssignmentsArr.Get(i, jsonTok) then

                       JsonObj := jsonTok.AsObject();

                   if JsonObj.Get('DocumentType', jsonTok) then

                       DocumentType := jsonTok.AsValue().AsText();

                   GetInvoice(jsonTok, DocumentType);

               end;

           end;

       end;

    Hope this code work for you (smile).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the August Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 774 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 569 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 296 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans