<?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: POST API to send file - Mastercard API in Product Forum</title>
    <link>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101054#M48153</link>
    <description>Hi Jian Jun,&lt;BR /&gt;&lt;BR /&gt;Since the whole request body is formatted in JSON, use the Body Content as "Template" instead of "Single File". Use the Base64 encoder from DX &lt;A href="https://digitalexchange.blueprism.com/dx/entry/3439/solution/base64encoder-2" target="test_blank"&gt;https://digitalexchange.blueprism.com/dx/entry/3439/solution/base64encoder-2&lt;/A&gt; to convert the binary file to Base64 string that you can then include in the JSON request.</description>
    <pubDate>Thu, 17 Mar 2022 07:49:00 GMT</pubDate>
    <dc:creator>shashank.kumar280</dc:creator>
    <dc:date>2022-03-17T07:49:00Z</dc:date>
    <item>
      <title>POST API to send file - Mastercard API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101053#M48152</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am looking for help with using POST method in Web API Services with Single File to perform the Mastercard API below.&lt;BR /&gt;How should I include the rest of the required details in the Body (ie amount, chargebackType, etc)?&lt;BR /&gt;&lt;BR /&gt;Common Header: Content-Type has value application/json&lt;BR /&gt;Request Body Content: Single File&lt;BR /&gt;File Parameter Name: File&lt;BR /&gt;&lt;BR /&gt;I have also loaded the pdf file into a binary data type (File) in blue prism using the function LoadBinaryFile()&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;API Documentation link:&lt;/STRONG&gt;&lt;BR /&gt;&lt;A href="https://developer.mastercard.com/mastercom/documentation/api-reference/v6-reference/" target="test_blank"&gt;https://developer.mastercard.com/mastercom/documentation/api-reference/v6-reference/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Request URL:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A href="https://api.mastercard.com/mastercom/v6/claims/{claim-id}/chargebacks" target="test_blank"&gt;https://api.mastercard.com/mastercom/v6/claims/{claim-id}/chargebacks&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG&gt;Body:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt;"amount": "100.00",&lt;BR /&gt;"chargebackType": "CHARGEBACK",&lt;BR /&gt;"currency": "USD",&lt;BR /&gt;"documentIndicator": "true",&lt;BR /&gt;"reasonCode": "4853",&lt;BR /&gt;"credPostedAsPurchase": false,&lt;BR /&gt;"isPartialChargeback": false,&lt;BR /&gt;"messageText": "This is a test message text",&lt;BR /&gt;"settlementDate": "2021-09-22",&lt;BR /&gt;"localTax1IVA": "0.60",&lt;BR /&gt;"installmentFee": 1.2,&lt;BR /&gt;"editExclusionCode": "BO",&lt;BR /&gt;"refundNotReceivedIndicator": "true",&lt;BR /&gt;"includeCurrencyConversionAssessmentCCA": "true",&lt;BR /&gt;"fileAttachment": {&lt;BR /&gt;"filename": "testimage111111.pdf",&lt;BR /&gt;"file": "This is an image file stored in a base64 encoded string"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 17 Mar 2022 06:23:29 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101053#M48152</guid>
      <dc:creator>Jian_JunSeow</dc:creator>
      <dc:date>2022-03-17T06:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: POST API to send file - Mastercard API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101054#M48153</link>
      <description>Hi Jian Jun,&lt;BR /&gt;&lt;BR /&gt;Since the whole request body is formatted in JSON, use the Body Content as "Template" instead of "Single File". Use the Base64 encoder from DX &lt;A href="https://digitalexchange.blueprism.com/dx/entry/3439/solution/base64encoder-2" target="test_blank"&gt;https://digitalexchange.blueprism.com/dx/entry/3439/solution/base64encoder-2&lt;/A&gt; to convert the binary file to Base64 string that you can then include in the JSON request.</description>
      <pubDate>Thu, 17 Mar 2022 07:49:00 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101054#M48153</guid>
      <dc:creator>shashank.kumar280</dc:creator>
      <dc:date>2022-03-17T07:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: POST API to send file - Mastercard API</title>
      <link>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101055#M48154</link>
      <description>&lt;P&gt;Hi Jian,&lt;BR /&gt;&lt;BR /&gt;Yes as Shashank said you will need to include the file as a BASE 64 encoded file. If you look at the Model tab of the call this is the description mastercard give.&lt;/P&gt;
&lt;TABLE class="mcs-props-table"&gt;
&lt;TBODY&gt;
&lt;TR class="mcs-model-prop"&gt;
&lt;TD&gt;fileAttachment&lt;/TD&gt;
&lt;TD&gt;&lt;SPAN class="model-highlight"&gt;DocumentStructure&lt;/SPAN&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR class="mcs-model-prop mcs-detail"&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD&gt;
&lt;DIV class="mcs-models-tooltip-inline"&gt;
&lt;DIV&gt;
&lt;P&gt;CONDITIONAL: Unless specified as REQUIRED, fileAttachment object is OPTIONAL. When fileAttachment is provided, then fileName and file parameters are required. The base64 encoded string must represent a ZIP, JPG, TIFF, or PDF file. Please note: ZIP files may contain JPG, TIFF or PDF files.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;BR /&gt;The parameter should be fileName with a capital N, as well as file. You can use the below encoder if this is going to be a variable parameter in your process and for testing use the following site for a proof of concept: &lt;A href="https://www.base64encode.org/&amp;nbsp;" target="test_blank"&gt;https://www.base64encode.org/&amp;nbsp;&lt;/A&gt;;&lt;BR /&gt;&lt;BR /&gt;I can also see you've used the data given as an example of 2021-09-22, however this won't work as it says above it "&lt;SPAN&gt;The date may not be prior to the current date or beyond 90 days from the current date." so change this to 2022-05-30 for your testing purposes.&lt;BR /&gt;&lt;BR /&gt;Hope this helps, best regards,&lt;BR /&gt;&lt;BR /&gt;Ronan&lt;/SPAN&gt;</description>
      <pubDate>Fri, 29 Apr 2022 15:41:47 GMT</pubDate>
      <guid>https://community.blueprism.com/t5/Product-Forum/POST-API-to-send-file-Mastercard-API/m-p/101055#M48154</guid>
      <dc:creator>RonanConsidine</dc:creator>
      <dc:date>2022-04-29T15:41:47Z</dc:date>
    </item>
  </channel>
</rss>

