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

Community site session details

Session Id :
Business Central forum

Call Dynamics 365 for Sales Web API sample

(0) ShareShare
ReportReport
Posted on by

Hi,

I'm looking for a sample on how to call the D356 Sales  odata / web api services from AL. Especially the authentication part. Any sources on this?

TIA

Categories:
I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at
    RE: Call Dynamics 365 for Sales Web API sample

    Hi,

    This is an indication for the authentication part:

    var

           vRequestMsg: HttpRequestMessage;

           vHeader: HttpvHeaders;

           vAuthTxt: Text;

           vTempBlob: Record TempBlob;

           ........

    BEGIN

           vRequestMsg.Method('POST');

           vRequestMsg.GetvHeaders(vHeader);

           vHeader.Add('Method', 'POST');

           vAuthTxt := StrSubstNo('%1:%2', GlobalWebServiceUsername, GlobalWebServicePassword);

           vTempBlob.WriteAsText(vAuthTxt, TextEncoding::Windows);

           vHeader.Add('Authorization', StrSubstNo('BASIC %1', vTempBlob.ToBase64String()));

    .

    I hope this helps you and answers your question.

    Please verify my answer if you find it helpful.

  • joshbooker Profile Picture
    on at
    RE: Call Dynamics 365 for Sales Web API sample

    Here is the http object bits:

    www.youtube.com/watch;list=PLcakwueIHoT-wVFPKUtmxlqcG1kJ0oqq4&index=30

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans