SolverTech.Tasha.Plugins.IO.SolutionRestApiExporter

Z Solvertech
Skočit na navigaci Skočit na vyhledávání
Jiné jazyky:

RestApi exporter is used to export data from the finished solution back to the customer (typically to an e-shop or accounting software).
Code example:

<?xml version="1.0" encoding="utf-8"?> <SolverTechTashaPlugInsIOSolutionRestApiExporterSettings xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

 <ExporterCaption>Rest Api Exporter</ExporterCaption>
 <RunOnEntityType>job</RunOnEntityType> 
 <BaseUrl>https://www.server.cz/modul/ppl/</BaseUrl> 
 <KeyValueDelimiter>;</KeyValueDelimiter>
 <ParameterKeyValuePairs>
   <string>@obj;identifier</string> 

<string>@dobirka;dobirka</string>

 </ParameterKeyValuePairs>
  <ServedCommandRequest> 
   <Method>GET</Method>
   <Resource></Resource> 
   <HeaderKeyValuePairs>
     <string>InternalID;@id</string> 
   </HeaderKeyValuePairs>
   <Body>{"objednavka":{"ID": @obj, "Dobirka": @dobirka}}</Body> 

<UrlSegment> <string>delete;@obj</string> </UrlSegment>

 </ServedCommandRequest>
   <Method></Method>
   <Resource></Resource>
   <HeaderKeyValuePairs></HeaderKeyValuePairs>
   <Body></Body>
 </NotServedCommandRequest>-->

</SolverTechTashaPlugInsIOSolutionRestApiExporterSettings>



It is also possible to get values from dynamic columns into the export, in the above example it is the column "cash on delivery" with the cash on delivery amount.

Generating authorization

If the client sends you authorization in username and password format, it is necessary to encode them in username:password format to Base64.

Generation example for username "tasha" and password "password"

  1. Open a web page that can encode to Base64 (e.g. https://www.base64encode.org/ or https://www.base64encode.net/ )
  2. Type tasha:password in the text box
  3. Click on "Encode" (or similar button)
  4. Copy the result to the config, in this case the string "dGFzaGE6aGVzbG8="