Using the Hello World Example

The Hello World example is a test/validation that works online or offline because it relies on a back-end server that is packaged with the Mashery Local build.

Note: The data should have already been imported into the Mashery Local Database.

Hello World Package Contents

The Hello World package includes:
  1. An API Definition
    1. Navigation: Home → API Definitions
    2. Name: hw_sample_service
    3. Oauth Enabled: False
  2. An Endpoint created under the API
    1. Navigation: Home → API Definitions → hw_sample_service → Endpoints
    2. Name: hw_sample_endpoint
    3. Published Endpoint: http://api.example.com/hw_path_01
    4. Origin Endpoint: http://localhost:9080/hello
  3. A Package
    1. Navigation: Home → Packages
    2. Name: hw_sample_package
  4. A Plan created under the Package
    1. Navigation: Home → Packages → hw_sample_package → Plans
    2. Name: hw_sample_plan
    3. Throttle Limit: 2 calls/sec
    4. Quota Limit: 5000 calls/day
    5. Endpoints associated: hw_sample_endpoint
  5. An Application
    1. Navigation: Home → Applications
    2. Name: hw_sample_app
  6. A Package Key
    1. Navigation: Home → Applications → hw_sample_app → Package Keys
    2. apikey: sra663fmnshjazx5sv2mgtmw
    3. Package - Plan: hw_sample_package - hw_sample_plan
    4. Status: active

Using the Hello World Application

The following code block displays the generic Hello World call:
curl -H 'Host:api.example.com' http://<tm_elb_name>/hw_path_01?api_key=<api_key>
The following code block displays the Hello World call example and its expected outcome:
curl -H 'Host:api.example.com''  
http://a3c8aa4e1ec3711e89aee063d70a1109-2122188248.us-east-1.elb.amazonaws.com/hw_path_01?api_key=sra663fmnshjazx5sv2mgtmw'
{"time":"2018-11-19 20:20:08.182+0000","message":"Hello
world"}
Note: The Hello World package is intended for use as a test/validation package. Creating endpoints under the Hello World API Definition (hw_sample_service) will not work. It is advised to create a new API Definition and add custom endpoints under the newly-created API.