Member Intergration function is designed to apply membership confirmation process of the client to the Online Contact help center. Through this function, members of the client service could submit member inquiries, and check the history of previous inquiries. Member Integration is provided in two types: GET method and POST method. For integrating, API needs to be developed according to the development specifications Online Contact provide.
① The user accesses to the help center within the APP. ② The APP of the customer company is called in the URL format below when help center is called. ② The client APP calls the help center through the URL format below. - https://{org}.oc.toast.com/{service}/hc/?usercode={user_id}&username={user_name}&email={user_email}&phone={user_phonenumber}&token={verification_token_value} ③ Help center calls 'Token Verification URL'. (Token verification URL must be developed according to the specifications provided below, and should be registered in member integration menu.) ④ If the verification result is successful after token verification, access the 'Inquiry' or 'Inquiry History' page. If the verification fails, the inquiry will be submitted as non-member inquiry.
① Access Service Management > Help Center > Member Integration
② Enable member integration
③ Select the 'Login Type' which matches the characteristics of the service
④ Develop and register necessary APIs according to the type
The authentication token generation sample is as follows. The order of parameters must be consistent with the given example. OC Organization Key is available at Global Management → Contract Service Status → Organization Information menu.
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(returnUrl)) {
sb.append(returnUrl); // 6
sb.append("&");
}
sb.append(time); // 7
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));
}
URL
URL (Dev)
Interface name | Protocol | Call direction | Encoding | Result format | Interface description |
---|---|---|---|---|---|
GET Member Verification | HTTPS | GET | UTF-8 | When the help center is accessed from the service side, the interface is called by adding customer information and token value to the URL as parameters. |
Name | Variable | Data type | Required | Description |
---|---|---|---|---|
Service ID | service | VARCHAR(50) | O | Service ID |
User ID | usercode | VARCHAR(50) | O | User ID, indicates that the user is unique |
Username | username | VARCHAR(50) | X | Username |
User Email Address | VARCHAR(100) | O | User email | |
Phone Number | phone | VARCHAR(20) | X | Phone number |
Membership Number | memberno | VARCHAR(50) | X | Membership number |
Timestamp of Current Time | time | Long | O | Time unit : milliseconds |
Authentication Token | token | VARCHAR | O | Calculated by the following parameters and organization key (SHA256). (If non-required parameter values are null or empty, exclude from creating token. Caution: The order of each value in the string must be consistent with the following example.) SHA256Digest(service + usercode + username + email + phone + memberno + returnUrl + time) |
Interface name | Protocol | Call direction | Encoding | Result format | Interface description |
---|---|---|---|---|---|
Token Verfication API | HTTPS | GET | UTF-8 | JSON | Service side checks the login status with token and usercode, and sends JSON format result value |
Name | Variable | Data type | Required | Description |
---|---|---|---|---|
User ID | usercode | VARCHAR(50) | O | User ID(Unique value) |
Token Created by Service Side | token | VARCHAR | O | Calculated by the following parameters and organization key (SHA256). (If non-required parameter values are null or empty, exclude from creating token. Caution: The order of each value in the string must be consistent with the following example.) SHA256Digest(service + usercode + username + email + phone + memberno + returnUrl + time) |
Logged in:
{
"login": "true",
"usercode":"usercodeXXX"
}
Not logged in:
{
"login": "false",
"usercode": null
}