# Java SDK

## I. Preparation

### 1) Obtain SDK Key Information

  - Obtain the SDK key information, which includes the PublicKey and PrivateKey. You can get these from [API Product/API Key](https://console.scloudsg.com/uapi/apikey). For detailed steps, refer to: [How to obtain Public and Private Keys](/docs/usms/faq/1109).

### 2) Obtain Project ID

  - This refers to the project ID of the current project in use under the current account. You can access the project ID from [Resource Statistics](https://console.scloudsg.com/dashboard). For detailed steps, refer to: [How to obtain Project ID](/docs/usms/faq/1109).

### 3) Apply for SMS Signature

  - **International SMS**: The SMS signature can be left blank for international SMS.

### 4) Apply for SMS Template

  - **International SMS**: You can apply for an SMS template independently in the **International SMS/SMS Signature** module of the [SMS Service Console](https://console.scloudsg.com/usms). For detailed application steps, refer to: [How to apply for SMS Template](/docs/usms/guide/5005/505#二、自助申请短信模板).

## II. Configure SDK

### 1) Install SDK

Refer to the SCloud SDK [Quick Start](/opensdk-java/quickstart) for installing the SDK.

### 2) Parameter Description

  - **Phone Number List** (PhoneNumbers): Supports both international SMS. For international SMS, use the format `(86)13812345678`, where the international dialing code is prefixed to the phone number.
  - **SMS Template ID** (TemplateId): First-time users need to apply for a template in the SCloud console. After approval, pass the template ID here.
  - **SMS Template Parameters** (TemplateParams): Variables can be passed into the SMS template. The number of variables to be passed corresponds to the number in the template at the time of application.
  - **SMS Signature** (SigContent): First-time users need to apply for a signature in the SCloud console. After approval, pass the signature here. The first applied signature is the default signature, and when there is a default signature, this parameter can be omitted.

### 3) Related Restrictions

1. SMS content is calculated as 1 character for each letter, Chinese character, or English punctuation mark. The length cannot exceed 600 characters.

2. The maximum number of characters for a **single send** is 500, where letters, Chinese characters, and English punctuation are each calculated as 1 character.

3. The SMS content should not contain special characters (you can check with the sensitive word detection tool on the SMS package page).

## III. Complete Example

Please contact technical support.