Posts

Showing posts with the label Microsoft Business Central

Consume Rest API in Business Central Code with Basic Auth

 Rest API Call With Basic Auth | Woo Commerce Rest API So i was working on some requirement of pushing products directly form Microrosft Business Central  to E-Commerce side i.e WOO-Commerce. so what we need is to consume the woo side API's into our AL code (BC SIDE) that requires the basic auth in case of https authentication. Here is a glimpse of code for understanding or picking some approach for the others seeking something like that in Business Central.   action( UnixTimestamp )             {                 ApplicationArea = All;                  trigger  OnAction ()                  var            ...

How to get nonce for rest Api call in Business Central AL Code.

How To Create Nonce for Rest API Call In Business Central Nonce is a random piece of string generated every time for web services call that require nonce in their header part i.e O Auth 1.0 uses nonce to be included in their header request, each time they are random and different for the call purpose. Scenario : I need the same random alphanumeric piece of string for the call so what i did was to use a  CREATEGUID, copystr and  DELCHr  methods already included in Business Central side. For detail please read Microsoft Documentation to be clear about methods used . 💥💪 trigger  OnAction ()                  begin                     RandomDigit  :=  CREATEGUID;                     Ra...

Reading json data in Business Central

  Read JsonObject In Buisness Central AL Code The following code is an example of how to read properties from a JsonObject. It is reading properties of the Json Object . * Also reading text into json object as a bonus to our readers 👽 Scenario: We are having simple Json value in a text type variable as an text and then reading out in a json object for having key and value properties so we can show it here how we are finding the key and value pair.      var        jsontext :  text ;        jsonobj :  JsonObject ;        JOrderNoToken:  JsonToken ;      begin           jsontext :=  '{"name": "test2908"}'; //  reading text value in json object        jsonobj . readfrom ( responseText ) ;             //  Now finding key and his value from json ...