Sample Program

Web Service (RESTful)

You can refer to the following website for request and response details:
https://service.hongkongpost.hk/ecshipAPI-trial/swagger-ui.html

To test the API, enter values to the corresponding request parameters and provid your API username and key for authentication at the website

Web Service (SOAP)

You do not have to create your interface from scratch. Below sample program can be used directly as your reference.

Samples for calling EC-Ship(Posting), (Postage), (Tracking) (JAVA)

  • This can be used to directly import the project file into a new project on Eclipse-based IDEs
  • JDK 1.6 or above is required
  • Readme File is included as setup guide

Samples for calling EC-Ship(Postage) (PHP)

  • PHP Version 5.6.3 was used for testing
  • The SOAP extension was used to write SOAP Client. You will need at least libxml-2.5.4.
  • Readme File (in PDF format) is included as setup guide

Samples for calling Speedpost API (JAVA)

  • This can be used to directly import the project file into a new project on Eclipse-based IDEs
  • JDK 1.6 or above is required
  • Readme File is included as setup guide

Samples for calling Bulk Mailing API API or iMail API (JAVA)

  • This can be used to directly import the project file into a new project on Eclipse-based IDEs
  • JDK 1.6 or above is required