<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Set header in api managment flow request in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735229#M206341</link>
    <description>&lt;P&gt;Hello again,&lt;/P&gt;
  &lt;P&gt;yes, this is absolutely feasible.&lt;/P&gt;
  &lt;P&gt;To do so, you would use a Service Callout policy, an Extract Variable policy and then an Assign Message policy again.&lt;/P&gt;
  &lt;P&gt;The Service Callout policy calls the external API.&lt;BR /&gt;The Extract Variable policy extracts the desired information from the response of the previous call.&lt;BR /&gt;The Assign Message policy does what you did first: assign a variable to a header.&lt;/P&gt;
  &lt;P&gt;I have documented it in detail in another blog:&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://blogs.sap.com/2016/10/11/sap-api-management-mash-api-proxy/" target="_blank"&gt;https://blogs.sap.com/2016/10/11/sap-api-management-mash-api-proxy/&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Hope this helps!&lt;BR /&gt;Sven&lt;/P&gt;</description>
    <pubDate>Wed, 25 Jul 2018 14:26:11 GMT</pubDate>
    <dc:creator>svenhuberti</dc:creator>
    <dc:date>2018-07-25T14:26:11Z</dc:date>
    <item>
      <title>Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaq-p/735226</link>
      <description>&lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Hi, I'm testing the api managment service and I'm having trouble doing the following:&lt;/P&gt;
  &lt;P&gt;I need to include a special header in the request flow, How should I perform this operation? Maybe with script policy preflow?&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Any idea how I could do this operation? Thnks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jul 2018 20:44:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaq-p/735226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-24T20:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735227#M206339</link>
      <description>&lt;P&gt;Hello Rodrigo,&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;you can use the "AssignMessage" Policy to do so.&lt;/P&gt;
  &lt;P&gt;Simply add a new policy into you pre-flow/conditional flow/post-flow, in the request.&lt;/P&gt;
  &lt;P&gt;If you are not sure where to place the policy, check Elijah's great blog on flows. At the beginning it may look complicated, but it is pretty simple and gives you great power!&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://blogs.sap.com/2016/03/17/sap-api-management-understanding-policy-flow/" target="_blank"&gt;https://blogs.sap.com/2016/03/17/sap-api-management-understanding-policy-flow/&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;And here is a simple example of the Assign Message policy:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  &amp;lt;AssignMessage async="false" continueOnError="false" enabled="true" xmlns='http://www.sap.com/apimgmt'&amp;gt;
    &amp;lt;Add&amp;gt;
        &amp;lt;Headers&amp;gt;
            &amp;lt;Header name="X-SvenTest"&amp;gt;Test&amp;lt;/Header&amp;gt;
        &amp;lt;/Headers&amp;gt;
    &amp;lt;/Add&amp;gt;
    &amp;lt;IgnoreUnresolvedVariables&amp;gt;true&amp;lt;/IgnoreUnresolvedVariables&amp;gt;
    &amp;lt;AssignTo createNew="false" transport="http" type="request"/&amp;gt;
  &amp;lt;/AssignMessage&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;And here the link to the documentation for more detailed information!&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;&lt;A href="https://help.sap.com/viewer/66d066d903c2473f81ec33acfe2ccdb4/Cloud/en-US/523efe6d0a9d43beb5d62ad07937578f.html?q=assign%20message" target="_blank"&gt;https://help.sap.com/viewer/66d066d903c2473f81ec33acfe2ccdb4/Cloud/en-US/523efe6d0a9d43beb5d62ad07937578f.html?q=assign%20message&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;
  &lt;P&gt;Cheers,&lt;BR /&gt;Sven&lt;/P&gt;
  &lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 06:42:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735227#M206339</guid>
      <dc:creator>svenhuberti</dc:creator>
      <dc:date>2018-07-25T06:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735228#M206340</link>
      <description>&lt;P&gt;Thank you for the answer, works perfect. &lt;/P&gt;
  &lt;P&gt;It is possible to obtain this value to be assigned to the new header making a request to another external API? &lt;/P&gt;
  &lt;P&gt;That is to say, make a prior request and use that response to assign a value to the next request.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:10:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735228#M206340</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-25T14:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735229#M206341</link>
      <description>&lt;P&gt;Hello again,&lt;/P&gt;
  &lt;P&gt;yes, this is absolutely feasible.&lt;/P&gt;
  &lt;P&gt;To do so, you would use a Service Callout policy, an Extract Variable policy and then an Assign Message policy again.&lt;/P&gt;
  &lt;P&gt;The Service Callout policy calls the external API.&lt;BR /&gt;The Extract Variable policy extracts the desired information from the response of the previous call.&lt;BR /&gt;The Assign Message policy does what you did first: assign a variable to a header.&lt;/P&gt;
  &lt;P&gt;I have documented it in detail in another blog:&lt;/P&gt;
  &lt;P&gt;&lt;A href="https://blogs.sap.com/2016/10/11/sap-api-management-mash-api-proxy/" target="_blank"&gt;https://blogs.sap.com/2016/10/11/sap-api-management-mash-api-proxy/&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;Hope this helps!&lt;BR /&gt;Sven&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 14:26:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735229#M206341</guid>
      <dc:creator>svenhuberti</dc:creator>
      <dc:date>2018-07-25T14:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735230#M206342</link>
      <description>&lt;P&gt;Thanks for the answer, it has served me a lot&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jul 2018 15:38:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/735230#M206342</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-07-25T15:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Set header in api managment flow request</title>
      <link>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/13678087#M4826589</link>
      <description>Hi Sven, When we apply header in Assign message policy, it works only in success scenarios. Can you let us know why the header is not visible in success scenaiors?</description>
      <pubDate>Mon, 22 Apr 2024 11:53:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/set-header-in-api-managment-flow-request/qaa-p/13678087#M4826589</guid>
      <dc:creator>13521697</dc:creator>
      <dc:date>2024-04-22T11:53:30Z</dc:date>
    </item>
  </channel>
</rss>

