Browse
 
Tools
Rss Categories

Updating your current web booking module to use the new API endpoint

Reference Number: AA-01234 Views: 173 Created: 2020-09-02 15:04 Last Updated: 2020-10-08 10:42 0 Rating/ Voters

API V3.2

SUMMARY OF CHANGES:

API URL structure is changing:

  1. API domain is changing to https://apis.rentalcarmanager.com
  2. /api/3.2/ in URL is changing to /booking/v3.2/
  3. For methods other than “main”, you must now add ?apikey=<key> to the end of the URL

E.g. From:  https://<old_server_domain>/api/3.2/<method>/<key>

To:  https://apis.rentalcarmanager.com/booking/v3.2/<method>/<key>?apikey=<key>

 

Where RCM standard web steps are being used, it is even simpler as these only call the “main” method:

From:  https://<old_server_domain>/api/3.2/main/<key>

To:  https://apis.rentalcarmanager.com/booking/v3.2/main/<key>

 

EXAMPLE OF PROCESS TO FOLLOW:

  1. Search for “.rentalcarmanager.com” in all pages… This will give you a start on what to change next:
  2. (a) If the web.config (AppSetting “ServerUrl”) is the only place that has this change, go to Step 3 below.
    (b) If this is found in the source pages, such as step1mini.aspx or Site.Master, go to Step 4 below.
  3. Simply changing the web.config AppSetting “ServerUrl” will not provide the appropriate update, as the domain is changing as well as the structure of the two parameters that come afterwards.  You will need to update the web.config AppSetting “ServerUrl” to be https://apis.rentalcarmanger.com AND ALSO make the changes as per Step 4 below, continuing to use this AppSetting.  Alternatively, remove this AppSetting altogether and follow Step 4 with hard-coded URL
  4. Search for “/api/3.2/” to find all references to our API.  For each instance,
    •  make sure the URL domain that comes before it is https://apis.rentalcarmanager.com . If you changed this in the web.config, and the API call is using the AppSetting “ServerUrl” then there is no need to change anything here.
    • Change “/api/3.2/” to “/booking/v3.2/” wherever this occurs
    • For any method other than “main”, add “?apikey=<key>” to the end of the URL (where <key> is the APIKey value.  Note that in these instances, the key will now be occurring twice in the URL (one is required for our WAF rules, the other to validate against the company)

SAMPLE 1 BEFORE (step1mini.aspx calling “main” method):
<script src='<%=ConfigurationManager.AppSettings("ServerUrl")%>/api/3.2/main/<%= ConfigurationManager.AppSettings("APIKey")%>' type="text/javascript"></script>


SAMPLE 1 AFTER:
<script src='https://apis.rentalcarmanager.com/booking/v3.2/main/<%=ConfigurationManager.AppSettings("APIKey")%>' type="text/javascript"></script>

 

SAMPLE 2 BEFORE (direct calling any method other than “main”):
https://secure2.rentalcarmanager.com/api/3.2/TEST_KEY_HERE    
SAMPLE 2 AFTER:
https://apis.rentalcarmanager.com/booking/v3.2/TEST_KEY_HERE?apikey=TEST_KEY_HERE

 

API V3.1

SUMMARY OF CHANGES:

API URL structure is changing:

  1. API domain is changing to https://apis.rentalcarmanager.com
  2. /api/3.1/ in URL is changing to /booking/v3.1/
  3. For methods other than “main”, you must now add ?apikey=<key> to the end of the URL, or &apikey=<key> where there are other querystring parameters present

E.g. From: https://<old_server_domain>/api/3.1/<key>/<method>/<params>

To: https://apis.rentalcarmanager.com/booking/v3.1/<key>/<method>/<params>?apikey=<key>

 

Where RCM standard web steps are being used it is even simpler, as it only calls the “main” method:

From: https://<old_server_domain>/api/3.1/main/<key>

To: https://apis.rentalcarmanager.com/booking/v3.1/main/<key>

 

EXAMPLE OF PROCESS TO FOLLOW:

  1. Search for “.rentalcarmanager.com” in all pages… These are all the places that will need updating.  Expect the following (depending on version of standard steps):
    •  Index.aspx
    • Step1Mini.aspx
    • Step2.aspx
    • Step3.aspx
    • Step3update.aspx
    • Step4.aspx
    • Step4confirm.aspx
    • Step5.aspx
  2. In each of these files, it should be the line that calls the “main” javascript file. 

SAMPLE 1 BEFORE (step1mini.aspx calling “main” method):

<script src="https://secure20.rentalcarmanager.com.au/api/3.1/main/<%=tst("Key")%>" type="text/javascript"></script>

 

SAMPLE 1 AFTER:

<script src="https://apis.rentalcarmanager.com/booking/v3.1/main/<%=tst("Key")%>" type="text/javascript"></script>

 

SAMPLE 2 BEFORE (direct calling step2 method):

https://secure20.rentalcarmanager.com.au/api/3.1/TEST_KEY_HERE/search/1/1/16_07_2020/11_54/1/23_07_2020/12_54/9/0/-/-

 

SAMPLE 2 AFTER:

https://apis.rentalcarmanager.com/booking/v3.1/TEST_KEY_HERE/search/1/1/16_07_2020/11_54/1/23_07_2020/12_54/9/0/-/-?apikey=TEST_KEY_HERE

 

TROUBLESHOOTING

Access Denied

If you receive an error Http Status 401 or "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." please try the following:

1. Make sure you've included apikey=XYZ on your querystring (where XYZ is your key).

2. Make sure the apikey value is not encoded in any way.  For e.g. if you have a "=" in your key, you must use "=" and not "%3D".  If this is not possible, please see Alternative Subscription Key method below.


Alternative Subscription Key

Where it is not possible to add apikey=XYZ to the URL, you can use the Request Headers instead.  Add a new Request Header named "Ocp-Apim-Subscription-Key", and add your API Key as the value.