cancel
Showing results for 
Search instead for 
Did you mean: 

Passing a variable token information to httpheader.Authorization parameter in HTTP Call atom

0 Kudos

Hi,

I am creating a scenario using B1if (version 1.22.28) in which I want to create a Sales Order in SAP Business One (version 10.0, PL 02) by fetching the data from a third party system. The handover of information from third party system is in the form of JSON.

In order to access the correct resource, I first need to get a token generated from the other system. There is no problem with this step and I am able to get the required token using an HTTP Call atom. Now, in the next step I need to use this token in order to access the required resource and here is where I am stuck.

I have created a variable ($Token) which stores the value of token generated from previous HTTPCall atom. Now, I want to pass this value to httpheader.Authorization parameter so that I get the access. However, from what I've seen so far I cannot pass the variable in the value of the parameter as it only accepts a fixed value. i.e. something like below.

<par id="httpheader.Authorization" value="Bearer Enbh4CIs1AROOmIBJyTzKH8YxIwW0m3ix3OnJp79ecGwD1L3663m_GHBz2PysBPUTx-iBUkgJfGNJrrLPXnriFsZgO1U93OeQPwra4eqeFFKfPbenz43oV5WgGTtn-8oHwxWCpbrP7tI7D7JssRCsRxE7vIM9omaAeKP2X9yYHGoiv27CZTSTCb0uWP_VCofMcC-XrKKBe_orTk-OKStb0Z7YPLYjTZznUxcPZONB_Uzh8plTYKPiJJZv71sNPke1LpESADp7EGr7eVCKxWWAA"></par>

But what I want is to do something like this (I know below code is wrong but it is only for understanding)

<par id="httpheader.Authorization" value="$Token"></par>

A quick help will be highly appreciated.

Let me know if any more information is required.

Best Regards,

Ninad Vaidya

agustin_pighin
Explorer
0 Kudos

Hello Ninad,

Did you manage to call the external Service with the Bearer Token?

Best regards,

Agustin.

Accepted Solutions (0)

Answers (1)

Answers (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ninad,

Prior to the http atom, please add an Xform atom, where you can prepare and have token set in the xml message, which could be retrieved in the following atoms.

for example, in xform atom, transform the output as:

<Token>xxfkejafkjd</Token>

In the http atom, now you can define a variable in xsl to retrieve the token from xform atom above, then used in the http call.

Kind Regards, Yatsea