# Short URL Service
## Introduction
Short URL API allows you to shorten long URLs while still directing users to right pages. This is useful for messaging technologies with character limits, such as SMS, or for shortening links in shared online meetings, such as Zoom.

For example, a long link `https://alm.insuremo.com/sf/frs/do/viewRelease/projects.income_gi/frs.test.2024011809_icgu_gs_v1_17_02_080` can be shortened to `https://ptdev-gw.insuremo.com/ebaoeco/1.0/r/Z7nAni`.

You can use `https://portal.insuremo.com/ebaoeco/short-url-vue-web/` to generate and manage your links.

## Workflow: How to Use Short URL Service?  

1. Click **Config** > **Category Config**. Then add a new short link with **Category Code** and **Category Name.**

![shortUrl](./image/short_url/pic001.png)
![shortUrl](./image/short_url/pic002.png)
![shortUrl](./image/short_url/pic003.png)

2. Click **Short Link Manage**. Then click **Add** to create a new short link.

![shortUrl](./image/short_url/pic005.png)

3. Enter **Original Link** and select **Expiry Date** of the short link.

![shortUrl](./image/short_url/pic004.png)

4. Select **Category** in the **Category Config** page, and then click **Confirm**.

![shortUrl](./image/short_url/pic006.png)

5. The new short link will be displayed on the search page.

![shortUrl](./image/short_url/pic008.png)

6. Copy this short link into your browser and press the Enter key.

![shortUrl](./image/short_url/pic009.png)

7. A page with the original link will open in your browser.

![shortUrl](./image/short_url/pic010.png)



In Non Insurance service, you will find the **ShortUrl Service** card. Click **API Details** for the details.

![shortUrl](./image/short_url/pic013.png)

**API Details** will provide direct access to the listed APIs.

You just need to use Generate ShortUrl API.

![shortUrl](./image/short_url/pic016.png)

## REST API: Create Short Links
### API Information 

| API Url                          | Method |
|----------------------------------|--------|
| https://{HOST}/ebaoeco/1.0/shortUrl | POST    |

### API Parameters

| Name    | Required | Type   | Description  | Example|
|---------|----------|--------|--------------|-----------------------------------------------------------------------------------------------------------------|
| longLink| Y     | String | Original Url | https://alm.insuremo.com/sf/frs/do/viewRelease/projects.income_gi/frs.test.2024011809_icgu_gs_v1_17_02_080 |
| userName | Y     | String | insureMO login user name | test123@e.com |
| expiryDate | Y      | String | Short Link Expiry Date | 9999-12-31 10:10:10|
| category | N      | String | Short Link Category | PD |

### Successful Response
`{
  "status": "200",
  "statusText": "Success",
  "shortUrl": "https://ptdev-gw.insuremo.com/ebaoeco/1.0/r/BbYj2a"
}`

### Failed Response
![shortUrl](./image/short_url/shortLinkfailed.png)

Enter the link into your browser and you will be redirected to the original URL.