Attachment

Notification > Notification Hub > API v1.0 User Guide > Attachment

Upload Attachments

Upload attachments. If specifying a FileType, you can upload the attachment for each product.

Request

POST /attachment/v1.0/attachments
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token

Request Body

Path Type Required Description
file Binary Y File to upload
fileName String Y File name
fileTypes Array N File type to upload

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "attachmentId" : "20230131070811m2fDe1rXx80",
  "results" : [ {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  } ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
attachmentId String Attachment ID.
results Array
results[].isSuccessful Boolean Indicates whether the operation was successful.
Default: true
results[].resultCode Integer The result code of the request.
Default: 0
results[].resultMessage String The result message of the request.
Default: SUCCESS

Request Example

IntelliJ HTTP
### Upload Attachments

POST {{endpoint}}/attachment/v1.0/attachments
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

cURL
curl -X POST "${endpoint}/attachment/v1.0/attachments" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}" 

Retrieve Attachment Lists

Retrieve attachment lists.

Request

GET /attachment/v1.0/attachments
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token
messageChannel Query V1x0MessageChannel N Message channel
fileType Query V1x0FileType N File type
fileName Query String N File name
limit Query Integer N If not set limit, default 50 (max. 1,000)
offset Query Integer N If not set offset, default 0

Request Body

This API does not require a request body.

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "totalCount" : 120,
  "attachments" : [ {
    "attachmentId" : "20230131070811m2fDe1rXx80",
    "fileName" : "test.txt",
    "fileFormat" : "JPG",
    "fileSizeByte" : 21391,
    "createDateTime" : "2024-10-29T06:00:01.000+09:00",
    "expireDateTime" : "2024-10-29T06:00:01.000+09:00",
    "uploadedFileTypes" : [ "EMAIL_DEFAULT" ]
  } ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
totalCount Integer Total number of attachments
attachments Array List of attachments
attachments[].attachmentId String Unique file ID generated upon successful file upload
attachments[].fileName String Uploaded file name
attachments[].fileFormat String File format
attachments[].fileSizeByte Long Attachment file size in bytes
attachments[].createDateTime String File uploaded at
attachments[].expireDateTime String File expired at
attachments[].uploadedFileTypes Array List of file types uploaded to each product

Request Example

IntelliJ HTTP
### Retrieve Attachment Lists

GET {{endpoint}}/attachment/v1.0/attachments
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

cURL
curl -X GET "${endpoint}/attachment/v1.0/attachments" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}" 

View Attachment Details

View attachments with attachment IDs.

Request

GET /attachment/v1.0/attachments/{attachmentId}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token
attachmentId Path String Y Attachment ID

Request Body

This API does not require a request body.

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "attachment" : {
    "attachmentId" : "20230131070811m2fDe1rXx80",
    "fileName" : "test.txt",
    "fileFormat" : "JPG",
    "previewUrl" : "https://www.example.com/preview/test.txt",
    "fileSizeByte" : 21391,
    "createDateTime" : "2024-10-29T06:00:01.000+09:00",
    "expireDateTime" : "2024-10-29T06:00:01.000+09:00",
    "uploadedFileTypes" : [ "EMAIL_DEFAULT" ]
  }
}
Path Type Not Null Description
header Object O
header.isSuccessful Boolean O Indicates whether the request was successful.
Default: true
header.resultCode Integer O Result code of the request.
Default: 0
header.resultMessage String O Result message of the request.
Default: SUCCESS
attachment Object O
attachment.attachmentId String O Unique file ID generated when a file is uploaded successfully
attachment.fileName String O Uploaded file name
attachment.fileFormat String O File format
attachment.previewUrl String X File preview URL — has an expiration time (generated when the detail view API is called)
attachment.fileSizeByte Long O Size of the attachment in bytes
attachment.createDateTime String O File upload date and time
attachment.expireDateTime String O File expiration date and time
attachment.uploadedFileTypes Array O List of file types uploaded to individual products

Request Example

IntelliJ HTTP
### View Attachment Details

GET {{endpoint}}/attachment/v1.0/attachments/{{attachmentId}}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

cURL
curl -X GET "${endpoint}/attachment/v1.0/attachments/${attachmentId}" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}" 

Validate Attachments before Upload

Validates attachments before they are uploaded. The system checks the file type, format, size, resolution, and dimensions (width/height) to ensure they meet the defined criteria.

Request

POST /attachment/v1.0/attachments/do-validate
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token

Request Body

This API does not require a request body.

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "results" : [ {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  } ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
results Array
results[].isSuccessful Boolean Indicates whether the operation was successful.
Default: true
results[].resultCode Integer The result code of the request.
Default: 0
results[].resultMessage String The result message of the request.
Default: SUCCESS

Request Example

IntelliJ HTTP
### Validate Attachments before Upload

POST {{endpoint}}/attachment/v1.0/attachments/do-validate
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

cURL
curl -X POST "${endpoint}/attachment/v1.0/attachments/do-validate" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}" 

Validate Attachments after Upload

Validates existing attachments against a new file type. This allows you to verify compatibility before calling the File Type Update API.

Request

POST /attachment/v1.0/attachments/{attachmentId}/do-validate
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token
attachmentId Path String Y Attachment ID

Request Body

{
  "fileTypes" : [ "EMAIL_DEFAULT" ]
}
Path Type Required Description
fileTypes Array Y File type list for validating attachments

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "results" : [ {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  } ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
results Array
results[].isSuccessful Boolean Indicates whether the operation was successful.
Default: true
results[].resultCode Integer The result code of the request.
Default: 0
results[].resultMessage String The result message of the request.
Default: SUCCESS

Request Example

IntelliJ HTTP
### Validate Attachments after Upload

POST {{endpoint}}/attachment/v1.0/attachments/{{attachmentId}}/do-validate
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

{
  "fileTypes" : [ "EMAIL_DEFAULT" ]
}
cURL
curl -X POST "${endpoint}/attachment/v1.0/attachments/${attachmentId}/do-validate" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}"  \ 
-d '{
  "fileTypes" : [ "EMAIL_DEFAULT" ]
}'

Update Uploaded Attachment File Type

Updates the file type of an uploaded attachment.

Request

POST /attachment/v1.0/attachments/{attachmentId}/file-types
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token
attachmentId Path String Y Attachment ID

Request Body

{
  "fileTypes" : [ "EMAIL_DEFAULT", "SMS_DEFAULT", "RCS_DEFAULT", "ALIMTALK_IMAGE", "ALIMTALK_ITEM_HIGHLIGHT_IMAGE" ]
}
Path Type Required Description
fileTypes Array X List of file types to specify when uploading attachments for individual products. One or more values can be entered. When uploading templates, use EMAIL_TEMPLATE for EMAIL and SMS_TEMPLATE for SMS.

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "results" : [ {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  } ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
results Array The result of the multiple resource tasks.
results[].isSuccessful Boolean Indicates whether the operation was successful.
Default: true
results[].resultCode Integer The result code of the request.
Default: 0
results[].resultMessage String The result message of the request.
Default: SUCCESS

Request Example

IntelliJ HTTP
### Update Uploaded Attachment File Type

POST {{endpoint}}/attachment/v1.0/attachments/{{attachmentId}}/file-types
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

{
  "fileTypes" : [ "EMAIL_DEFAULT", "SMS_DEFAULT", "EMAIL_TEMPLATE", "SMS_TEMPLATE" ]
}
cURL
curl -X POST "${endpoint}/attachment/v1.0/attachments/${attachmentId}/file-types" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}"  \ 
-d '{
  "fileTypes" : [ "EMAIL_DEFAULT", "SMS_DEFAULT", "EMAIL_TEMPLATE", "SMS_TEMPLATE" ]
}'

List Attachment File Types

Views the list of supported attachment types. Select a message channel to see the specific file types available for that channel.

Request

GET /attachment/v1.0/attachments/file-types
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

Request Parameter

Name Category Type Required Description
X-NC-APP-KEY Header String Y Appkey
X-NHN-Authorization Header String Y Access token
messageChannel Query V1x0MessageChannel N Message channel

Request Body

This API does not require a request body.

Response Body

{
  "header" : {
    "isSuccessful" : true,
    "resultCode" : 0,
    "resultMessage" : "SUCCESS"
  },
  "fileTypes" : [ "EMAIL_DEFAULT", "SMS_DEFAULT", "RCS_DEFAULT", "ALIMTALK_IMAGE", "ALIMTALK_ITEM_HIGHLIGHT_IMAGE" ]
}
Path Type Description
header Object
header.isSuccessful Boolean Indicates whether the operation was successful.
Default: true
header.resultCode Integer The result code of the request.
Default: 0
header.resultMessage String The result message of the request.
Default: SUCCESS
fileTypes Array File type list

Request Example

IntelliJ HTTP
### Retrieve a List of Attachment File Types

GET {{endpoint}}/attachment/v1.0/attachments/file-types
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: Bearer {accessToken}

cURL
curl -X GET "${endpoint}/attachment/v1.0/attachments/file-types" \
-H "X-NC-APP-KEY: {appKey}"  \ 
-H "X-NHN-Authorization: Bearer {accessToken}" 
TOP