<?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>topic Re: How to GET API with a base URL that changes? in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100681#M47866</link>
    <description>&lt;P&gt;Hi Joe,&lt;BR /&gt;&lt;BR /&gt;I am perhaps missing the point, but isn't this as simple as a Calculation stage doing this:&lt;BR /&gt;&lt;BR /&gt;Replace("https://website.api/MyItemName/​", "MyItemName", [Current Item])&lt;BR /&gt;&lt;BR /&gt;...where [Current Item] contains "blue-item" or any of the other varieties?&lt;BR /&gt;&lt;BR /&gt;Or perhaps simply:&lt;BR /&gt;&lt;BR /&gt;Replace([URL], "MyItemName", [Current Item])&lt;BR /&gt;&lt;BR /&gt;...where [URL] contains "https://website.api/MyItemName/​", and [Current Item] contains "blue-item" or any of the other varieties?&lt;/P&gt;</description>
    <pubDate>Fri, 30 Sep 2022 09:21:54 GMT</pubDate>
    <dc:creator>PvD_SE</dc:creator>
    <dc:date>2022-09-30T09:21:54Z</dc:date>
    <item>
      <title>How to GET API with a base URL that changes?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100680#M47865</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am trying to build an object to call an API to get some information about different items. The item names form the base URL, and are not a parameter or header.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;URL format:&lt;/STRONG&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;https://website.api/[ITEM_NAME]/​&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;
&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Examples:&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE class="language-markup"&gt;&lt;CODE&gt;&lt;A href="https://website.api/blue-item/" target="test_blank"&gt;https://website.api/blue-item/&lt;/A&gt;

&lt;A href="https://website.api/red-item/" target="test_blank"&gt;https://website.api/red-item/&lt;/A&gt;

&lt;A href="https://website.api/green-item/" target="test_blank"&gt;https://website.api/green-item/&lt;/A&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;I'd like to have a data item in the Blue Prism object or process that can be overwritten to replace [ITEM_NAME] in the URL format. Is this possible? I have been able to do this for parameters and headers after configuring the API (in System &amp;gt; Web API Services), but haven't found a solution for the base URL path changing itself.&lt;BR /&gt;&lt;BR /&gt;Apologies if I have misunderstood something here, thanks.&lt;/P&gt;
​</description>
      <pubDate>Thu, 29 Sep 2022 09:50:42 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100680#M47865</guid>
      <dc:creator>JoeS</dc:creator>
      <dc:date>2022-09-29T09:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to GET API with a base URL that changes?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100681#M47866</link>
      <description>&lt;P&gt;Hi Joe,&lt;BR /&gt;&lt;BR /&gt;I am perhaps missing the point, but isn't this as simple as a Calculation stage doing this:&lt;BR /&gt;&lt;BR /&gt;Replace("https://website.api/MyItemName/​", "MyItemName", [Current Item])&lt;BR /&gt;&lt;BR /&gt;...where [Current Item] contains "blue-item" or any of the other varieties?&lt;BR /&gt;&lt;BR /&gt;Or perhaps simply:&lt;BR /&gt;&lt;BR /&gt;Replace([URL], "MyItemName", [Current Item])&lt;BR /&gt;&lt;BR /&gt;...where [URL] contains "https://website.api/MyItemName/​", and [Current Item] contains "blue-item" or any of the other varieties?&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 09:21:54 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100681#M47866</guid>
      <dc:creator>PvD_SE</dc:creator>
      <dc:date>2022-09-30T09:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to GET API with a base URL that changes?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100682#M47867</link>
      <description>Hi Joe,&lt;BR /&gt;&lt;BR /&gt;For Web API Services feature, you can create Common Parameters, and choose to expose them to processes. When specifying the Base URL, use placceholders enclosed by a pair of square bracket to reference the Common Parameters defined.&lt;BR /&gt;&lt;BR /&gt;In your case, you will have https://website.api/[ITEM_NAME]/​ as Base URL, and then a Common Parameter called ITEM_NAME of type Text exposed to process so you can manipulate as needed by your process.</description>
      <pubDate>Thu, 06 Oct 2022 01:22:32 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100682#M47867</guid>
      <dc:creator>bruce.liu</dc:creator>
      <dc:date>2022-10-06T01:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to GET API with a base URL that changes?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100683#M47868</link>
      <description>Thank you Paul and Bruce for your replies,&lt;BR /&gt;&lt;BR /&gt;&lt;A class="user-content-mention" data-sign="@" data-contactkey="0a9b5778-7ac7-4764-a9c9-822633ad2ffb" data-tag-text="@Bruce Liu" href="https://community.blueprism.com/people/bruce-liu1" data-itemmentionkey="638e5a92-4a5a-4e31-8105-9e07d6862428"&gt;@Bruce Liu&lt;/A&gt; I can follow your steps okay and made an object that successfully calls the API and gets a response - but only when the [ITEM_NAME] text is entered into the action itself. When I try to use a data item variable in the object to send values into the action stage, I get a HTTP bad request error. I've tried with the data item text in double quotes and without, both produce the HTTP error response. &lt;BR /&gt;&lt;BR /&gt;I'm not sure why this is the case, the data item should just be passing whatever text into the action stage, right? And the action stage itself works. Any advice would be very appreciated.​</description>
      <pubDate>Thu, 06 Oct 2022 10:01:14 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100683#M47868</guid>
      <dc:creator>JoeS</dc:creator>
      <dc:date>2022-10-06T10:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to GET API with a base URL that changes?</title>
      <link>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100684#M47869</link>
      <description>Hi Joe,&lt;BR /&gt;&lt;BR /&gt;See below for an example of the use of placeholder of what I meant. I have also attached a BP release with the example for your information. Note that you may not be able to run this in your environment.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36545.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36557i994AA104D52D7DAE/image-size/large?v=v2&amp;amp;px=999" role="button" title="36545.png" alt="36545.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36546.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36556iA64632C0714AC319/image-size/large?v=v2&amp;amp;px=999" role="button" title="36546.png" alt="36546.png" /&gt;&lt;/span&gt;&lt;BR /&gt;To troubleshoot your request, you can consider enable the following two options in your request. This will expose the full request in the way how Blue Prism will send it but not actually sending it to the host. In your process/object, kindly expose these data items to see the results. In this way, you can inspect how the placeholder you created would impact your web request.&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="36547.png"&gt;&lt;img src="https://community.blueprism.com/t5/image/serverpage/image-id/36558i10648FC9EE0A34FF/image-size/large?v=v2&amp;amp;px=999" role="button" title="36547.png" alt="36547.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Hope this helps.</description>
      <pubDate>Fri, 07 Oct 2022 06:08:33 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/How-to-GET-API-with-a-base-URL-that-changes/m-p/100684#M47869</guid>
      <dc:creator>bruce.liu</dc:creator>
      <dc:date>2022-10-07T06:08:33Z</dc:date>
    </item>
  </channel>
</rss>

