> For the complete documentation index, see [llms.txt](https://docs.contiple.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.contiple.com/eng/api-guide/open-api/get.md).

# Member Interlink (GET Method)

{% hint style="info" %}
**What is a member interlink?**

This feature applies your service’s member authentication to the Contiple Help Center, allowing users to submit member-only inquiries and view their submitted inquiry history.
{% endhint %}

***

## **➊ Member Interlink**

### **1-1. Overview** <a href="#id-2" id="id-2"></a>

* Member integration supports **two types of API methods: GET and POST**.
  * **POST Method**
    * This method is suitable for services provided on **web-based platforms** (PC or Mobile).
    * The service must provide a **web-based login page (URL)**.
    * Two implementation types are supported, as defined in the development specifications: Client-side, Server-side
  * **GET Method**
    * This method is suitable for services that **do not provide a web-based login page**.
    * Recommended for **native application–based services** (non-web).
* To enable integration, please implement the API according to the specifications provided by Contiple and register it in the **Member Integration** settings.

***

### **1-2. Process (GET Method)**

{% stepper %}
{% step %}

#### Accessing the Help Center

* When a user accesses the Help Center from the app, the Help Center is opened using the specified URL format.
  * https\://{org}.oc.nhncloud.com/{service}/hc/?usercode={User ID}\&username={User Name}\&email={User Email Address}\&phone={User Phone Number}\&token={Autentication Token Value}
    {% endstep %}

{% step %}

#### Token Verification URL Call

* The Help Center calls the **Token Verification URL** to validate the token.
* The Token Verification URL must be implemented by the service provider according to the development specifications and registered in the Contiple member integration settings.
  {% endstep %}

{% step %}

#### Accessing Inquiry Features

* If token verification is successful, the user can access **Submit Inquiry** or **Inquiry History**.
* If token verification fails, the user can submit inquiries only as a **guest (non-member)**.
  {% endstep %}
  {% endstepper %}

***

### **1-3. Member Authentication Method**

{% stepper %}
{% step %}

#### Enable Member Integration

* Navigate to **\[Service Management] → \[Help Center] → \[Member Intelink]**.
* Enable the **Member Integration Activation** option to enable the feature.
  {% endstep %}

{% step %}

#### Non Member Inquiry

* **Enabled**: Users can submit inquiries without logging in.
* **Disabled**: Only logged-in users are allowed to submit inquiries.
  {% endstep %}

{% step %}

#### Login Type

* Select **GET** as the login method.
  {% endstep %}

{% step %}

#### Token Verification URL

* This is the URL used to verify the token passed from your service when accessing the Help Center.
* Enter the Token Verification URL implemented according to the development specifications below, then click **Save** to complete the setup.
  {% endstep %}
  {% endstepper %}

***

## **➋ Development Specifications**

### **2-1. Token Generation**

{% hint style="info" %}
**Contiple Organization Key**

* You can find the organization key under:\
  \&#xNAN;**\[Global Management] → \[Contract Services Status] → \[Organization Information]**
  {% endhint %}

{% hint style="danger" %}
**Token Generation Rule**

* Generate the token according to the sample below.
* The **parameter order must strictly follow the sequence defined below**.
  * In the example, the organization key is stored in `Sample project > application.properties > oc.apikey=`.
    {% endhint %}

```java
private String getSHA256Token(String serviceId, String usercode, String username, String email, String phone,
        String returnUrl, Long time, String apiKey) throws Exception {
    StringBuilder sb = new StringBuilder();
    // Order by follow number:
    sb.append(serviceId); // 1
    sb.append("&");
    sb.append(usercode); // 2
    sb.append("&");
    if (StringUtils.isNotBlank(username)) {
        sb.append(username); // 3
        sb.append("&");
    }
    if (StringUtils.isNotBlank(email)) {
        sb.append(email); // 4
        sb.append("&");
    }
    if (StringUtils.isNotBlank(phone)) {
        sb.append(phone); // 5
        sb.append("&");
    }
    　if (StringUtils.isNotBlank(memberno)) {
        sb.append(memberno); // 6
        sb.append("&");
    　}
    if (StringUtils.isNotBlank(returnUrl)) {
        sb.append(returnUrl); // 7
        sb.append("&");
    }
    sb.append(time); // 8

    SecretKeySpec signingKey = new SecretKeySpec(apiKey.getBytes("UTF-8"), "HmacSHA256");
    Mac mac = Mac.getInstance(signingKey.getAlgorithm());
    mac.init(signingKey);
    byte[] rawHmac = mac.doFinal(sb.toString().getBytes("UTF-8"));
    return new String(Base64.encodeBase64(rawHmac));
}

// Sample
// Use this same input, the output is : Ah9M58CQ9RFTShjFuqziQr+0MjmJxN6+bzWxMD71moo=
public static void main(String[] args) throws Exception {
    String s = getSHA256Token("hangame", "testusercode", "testUsername", "test@email.com", "123456789",
    null, 1660095873001L, "7cf2828608274a49a3f06152b2188927");
    System.out.println(s); // Output: Ah9M58CQ9RFTShjFuqziQr+0MjmJxN6+bzWxMD71moo=
}
```

***

### **2-2. GET Member Authentication Method**

#### **(1) Interface Description**

URL

* https\://{org}.oc.nhncloud.com/{service}/hc/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d
* https\://{org}.oc.nhncloud.com/{service}/hc/ticket/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d
* https\://{org}.oc.nhncloud.com/{service}/hc/ticket/list/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d

URL(Development)

* https\://{domain}.oc.alpha-nhncloud.com/{service}/hc/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d
* https\://{domain}.oc.alpha-nhncloud.com/{service}/hc/ticket/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d
* https\://{domain}.oc.alpha-nhncloud.com/{service}/hc/ticket/list/?usercode=aaaabbb\&username=yzg\&email=<yzgname@163.com>\&phone=12345678901\&time=12345678\&token=8NPaBegAfbSvh1Lna9M0I1wBqjnoRyKO2r2izhuEAng%3d

| Interface Name | Protocol | Request Format | Encoding | Response Format | Interface Description                                                                                                |
| -------------- | -------- | -------------- | -------- | --------------- | -------------------------------------------------------------------------------------------------------------------- |
| GET 회원인증       | HTTPS    | GET            | UTF-8    |                 | When accessing the Help Center, the service must pass customer information and an encrypted token as URL parameters. |

***

#### **(2) Request Parameter**

{% hint style="danger" %}
**Notes for token generation**

1. If the token contains Korean characters, they should be used as-is without encoding.
2. When passing the token as a URL parameter, it must be encoded using the `encodeURIComponent()` method.
   {% endhint %}

<table><thead><tr><th width="156">Name</th><th width="119">Field (Parameter)</th><th width="153">Type</th><th width="81">Required</th><th>Description</th></tr></thead><tbody><tr><td><strong>Service ID</strong></td><td>service</td><td>VARCHAR(50)</td><td>O</td><td>Service ID</td></tr><tr><td><strong>User ID</strong></td><td>usercode</td><td>VARCHAR(50)</td><td>O</td><td>User ID(Unique Value)</td></tr><tr><td><strong>User Name</strong></td><td>username</td><td>VARCHAR(50)</td><td>X</td><td>User Name</td></tr><tr><td><strong>User Email Address</strong></td><td>email</td><td>VARCHAR(100)</td><td>O</td><td>User Email Address</td></tr><tr><td><strong>User Phone Number</strong></td><td>phone</td><td>VARCHAR(20)</td><td>X</td><td>User Phone Number</td></tr><tr><td><strong>Member No.</strong></td><td>memberno</td><td>VARCHAR(50)</td><td>X</td><td>Member No.</td></tr><tr><td><strong>Timestamp</strong></td><td>time</td><td>LONG</td><td>O</td><td>Time unit: milliseconds</td></tr><tr><td><strong>Authentication Token</strong></td><td>token</td><td>VARCHAR</td><td>O</td><td>Generate the token using the following parameters and the organization key.<br>Optional parameters that are <code>null</code> or empty must be excluded.<br>The parameter order must strictly follow the specified sequence.<br>SHA256Digest(service + usercode + username + email + phone + memberno + returnUrl + time)</td></tr></tbody></table>

***

#### **(3) Response Data**

* If token verification **succeeds**, the user is redirected to the member page.
* If token verification **fails**, the user is redirected to the non-member page.
* If access to **inquiry history fails due to token validation**, the user is redirected to the inquiry submission page.

***

### **2-3. Token Verification URL (By the Service)**

#### **(1) Interface Description**

* URL: The URL must be provided by the service.
* URL(Development): The URL must be provided by the service.

| Interface Name            | Protocol | Request Format | Encoding | Response Format | Interface Description                                                                |
| ------------------------- | -------- | -------------- | -------- | --------------- | ------------------------------------------------------------------------------------ |
| **Token VerificationURL** | HTTPS    | GET            | UTF-8    | JSON            | The service verifies the token and userCode, then returns the result in JSON format. |

***

#### **(2) Request Parameter**

<table><thead><tr><th>Name</th><th width="125">Field (Parameter)</th><th>Type</th><th width="70">Required</th><th>Description</th></tr></thead><tbody><tr><td><strong>User ID</strong></td><td>usercode</td><td>VARCHAR(50)</td><td>O</td><td>User ID(Unique Value)</td></tr><tr><td><strong>Token generated by the service</strong></td><td>token</td><td>VARCHAR</td><td>O</td><td>When accessing Contiple (Online Contact) via GET, the token must be included in the request.</td></tr></tbody></table>

***

#### **(3) Response Body**

```json
로그인:
{
"login": "true",
"usercode":"usercodeXXX"
}


로그아웃:
{
"login": "false",
"usercode": null
}
```
