Hi All,

This document will guide you how to use google URL hortener API in SAP.

1. Get the API key.

  • Goto console.developers.google.com
  • Click the URL Shortener API link.

     1.JPG

  • Create a project (skip if you already have)

     2.JPG

  • Create API Key (This server key will be used while consumption of service)

     3.JPG

          [Now you have the API key say: AIzaSyB_UdivSkXmuV85ytAZ59FWkXFF6uaaS2V]

2. Now we need to add Certificate in SAP as SAP assumes response is from non-trusted site.

  • Get the *.cer file for above URL.
    • Open the URL in Google chrome and click the lock image.

            4.JPG

    • Click the certificate Information link

               5.JPG

    • In the popup goto Details tab and click on ‘copy to file’ button.

               6.JPG

    • Specify file format and file name in the appeared wizard and generate *.cer file.

               7.JPG

    • Now you have Google API certificate file (say : GoogleUrlShortener.cer)


  • Add the certificate to trusted list in SAP.
    • Goto tcode: STRUST
    • Choose SSL client SSL Client (Anonymo->Import certificate → Select *.cer file and click (OK)

          8.JPG

    • Now click Add to Certificate List          

          9.JPG

               [Here Certificate has been added in SSL Client Anonymo whose SSL id is ANONYM ]

          10.JPG

  • Goto tcode: SMICM to restart ICM process.

      11.JPG

3.  Use Session ID: ANONYM while creating object of if_http_client.

       12.JPG


[For sample code check the attached ZTEST_P.html file]

Thanks and regards,

Pramod Kumar Mandal.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply