How to use WinsurTech AL3 REST API on RapidApi

20.05.2021
|
0 Comments
|
|

OVERVIEW

    • Go to RapidAPI website – https://rapidapi.com/
    • If you are visiting for the first time, you need to sign up, otherwise, you can simply log in from the top navigation bar.
  • Sign up

        • After clicking on the signUp button, you will end up on the form. 
        • Fill up the simple form with correct information and click the Sign-Up button.
  • Login

      • Enter your email address and password.
      • Click the Sign In button.

For WINSURTECH Apis –

  • Search al3 in the search box and press enter.
  • You will see the Winsurtech api in the result.

  • Click on this, and you will land up on our page

Endpoints

  • AL3 to JSON Conversion
  • Check Transaction Status
  • Fetch Output
  • AL3 to JSON Conversion with Callback URL

In the left side menu, you will get a list of all the apis we provide.

  • Click any API you want to test or use.

Testing API

  • Click the button subscribe to Test
  • After clicking the button, you will see different plans as shown below

  • Select any plan as per your usage and requirements. “We also provide a free plan”.

Requirements to run API through a program

You only need one thing i.e., your RapidAPI key. You need to pass that key into the header.

Where to find Rapid API key

  •  Login to Rapid API account.
  •  Go to MyApps from the top nav menu.

  • From sidebar, under MyApps click arrow to open drop down menu

  • Go to security.

  • And your application key is your secret key, click the icon to see and copy your key.

 

Note – You need to pass a key-value pair in the header and the key should be

X-RapidAPI-Key: “your key”

For example your key is a1b2c3d4efg567        

        CURLOPT_HTTPHEADER => [
           “Content-type : multipart/form-data”,
           “X-rapidapi-host : acord-al3-to-json-or-xml.p.rapidapi.com”,
           “X-rapidapi-key : a1b2c3d4efg567
      ],

==sample code in php

<?php

$file = “C:\Users\india\Desktop\my office\al3inputFiles\BOAT_copy-648353881.DAT”;
$fileData =  file_get_contents($file);
$postRequest = array(
‘input_file’ => $fileData,
‘output_format’ => ‘json’,
‘ob_flag’ => ‘y’

);
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => “
https://acord-al3-to-json-or-xml.p.rapidapi.com/conversion“,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_ENCODING => “”,
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => “POST”,
CURLOPT_POSTFIELDS => $postRequest,
CURLOPT_HTTPHEADER => [
“content-type: multipart/form-data”,
“x-rapidapi-host: acord-al3-to-json-or-xml.p.rapidapi.com”,
“x-rapidapi-key: /*your secret key*/”
],

]);

/* Where to find secret key –
1) Login to rapid api account.
2) Go to MyApps from top nav menu
3) From sidebar, under MyApps select your app and go to security
4) And your application key is your secret key
*/

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo “cURL Error #:” . $err;
} else {
echo $response;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

Share on:
Share this...
Share on Facebook
Facebook
Pin on Pinterest
Pinterest
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin
Website security
Contact Us