Upload attachment

Prev Next

Available in Classic and VPC

Upload a file for sending an MMS.

Request

This section describes the request format. The method and URI are as follows:

Method URI
POST /sms/v2/services/{serviceId}/files

Request headers

For information about the headers common to all Simple & Easy Notification Service APIs, see Simple & Easy Notification Service request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
serviceId String Required SMS service ID

Request body

You can include the following data in the body of your request:

Field Type Required Description
fileName String Required Attachment name
  • 0-40 characters
  • File name with .jpg and .jpeg extensions
fileBody String Required Attachment content (kbyte)
  • 0-300
  • Base64-encoded value of a JPG or JPEG image.
  • Maximum resolution of 1500 x 1440 allowed.
  • If a prefix is present, it must be removed. (Example: data:image/png;base64,)
Note

If a file with the same name and file size as the file you are uploading already exists, the file is recognized as the same file and reused. (Retained for 6 days)

Request example

The request example is as follows:

curl --location --request POST 'https://sens.apigw.ntruss.com/sms/v2/services/ncp:sms:kr:50*********1:sens/files' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
    "fileName": "G0ufjqMy3wBpCucJenTaU.jpg",
    "fileBody": "/9j/4QC8RXhpZgAASUkqAAgAAAAGABIBAwABAAA...AAAAAAAAAAAAAAAAAAAAAAAAAAH/9k="
}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
fileId String Required Attachment ID
createTime String Required Attachment creation date and time
  • YYYY-MM-DDTHH:mm:ss.sss format
expireTime String Required Attachment expiration date and time
  • YYYY-MM-DDTHH:mm:ss.sss format

Response status codes

For information about the HTTP status codes common to all Simple & Easy Notification Service APIs, see Simple & Easy Notification Service response status codes.

Response example

The response example is as follows:

{
    "fileId": "a136************************74f7",
    "createTime": "2025-11-25T10:12:47.520",
    "expireTime": "2025-11-27T10:12:47.520"
}