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, copystrand 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;
RandomDigit := DELCHr(RandomDigit, '=', '{}-01');
RandomDigit := copystr(RandomDigit, 1, 8);
result := RandomDigit;
Message('Random Digit : %1',result );
end;
Comments
Post a Comment