파일 업로드

Request

POST https://api.solapi.com/storage/v1/files

파일을 업로드합니다.

타입별 제한 사이즈

  • [KAKAO] : 500KB

  • [MMS] : 200KB

  • [DOCUMENT] : 2MB

Authorization 인증 필요 [?]

계정 권한

회원 권한

계정 상태

회원 상태

계정 인증

storage:write

ACTIVE

ACTIVE

Request Structure

{
    "file": "string",
    "name": "string",
    "type": "string",
    "link": "string"
}

Body Params

Name

Type

Required

Description

file

string

O

파일 (base64 encoded)

name

string

파일 이름

type

string

문서 타입(DOCUMENT, KAKAO, MMS)

link

string

이미지를 눌렀을 때 이동할 링크

Response

Response Structure

{
    "kakao": {
        "daou": "string",
        "biztalk": "string"
    },
    "type": "string",
    "originalName": "string",
    "link": "string",
    "fileId": "string",
    "name": "string",
    "url": "string",
    "accountId": "string",
    "references": [
        "string"
    ],
    "dateCreated": "date",
    "dateUpdated": "date"
}

Response Description

Response /

Name

Type

Should Return

Description

object

카카오 채널 발송(알림톡, 친구톡)에 사용되는 정보

type

string

O

문서 타입(DOCUMENT, KAKAO, MMS)

originalName

string

O

원본 파일 이름

link

string

이미지를 눌렀을 때 이동할 링크

fileId

string

O

파일 고유 아이디

name

string

O

파일 이름

url

string

O

파일 주소

accountId

string

O

계정 고유 아이디

references

array

해당 파일 사용처 목록

dateCreated

date

O

최초 생성 날짜

dateUpdated

date

O

최근 수정 날짜

Response / kakao

Name

Type

Should Return

Description

daou

string

다우기술에 등록되어있는지 여부

biztalk

string

비즈톡에 등록되어있는지 여부

Samples

PNG 업로드

Sample Request

{
    "file": "iVBORw0KGgoAAAANSUhEUgAAAyA..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "9XIiq.png",
    "link": null,
    "width": 800,
    "height": 500,
    "fileSize": 503111,
    "fileId": "ST01FP200923042740594oism3eYSGkp",
    "name": "9XIiq.png",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FP200923042740594oism3eYSGkp",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:40.722Z",
    "dateUpdated": "2020-09-23T03:27:40.722Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'iVBORw0KGgoAAAANSUhEUgAAAyA...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

PNG 업로드 (이름 포함)

Sample Request

{
    "file": "iVBORw0KGgoAAAANSUhEUgAAAyA...",
    "name": "smile.png"
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "smile.png",
    "link": null,
    "width": 800,
    "height": 500,
    "fileSize": 503111,
    "fileId": "ST01FP200923042740771cFpGzt93M8M",
    "name": "DbWJ0.png",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FP200923042740771cFpGzt93M8M",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:40.845Z",
    "dateUpdated": "2020-09-23T03:27:40.845Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'iVBORw0KGgoAAAANSUhEUgAAAyA...',
    name: 'smile.png'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

JPG 업로드

Sample Request

{
    "file": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "bUEBm.jpg",
    "link": null,
    "width": 1020,
    "height": 510,
    "fileSize": 124814,
    "fileId": "ST01FJ2009230427408726kPo30lKLCO",
    "name": "bUEBm.jpg",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FJ2009230427408726kPo30lKLCO",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:40.932Z",
    "dateUpdated": "2020-09-23T03:27:40.932Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: '/9j/4AAQSkZJRgABAQAAAQABAAD...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

JPEG 업로드

Sample Request

{
    "file": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "Rjm1D.jpg",
    "link": null,
    "width": 629,
    "height": 436,
    "fileSize": 127596,
    "fileId": "ST01FJ200923042740949JjchK8kCjIN",
    "name": "Rjm1D.jpg",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FJ200923042740949JjchK8kCjIN",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.052Z",
    "dateUpdated": "2020-09-23T03:27:41.052Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: '/9j/4AAQSkZJRgABAQAAAQABAAD...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

TIF 업로드

Sample Request

{
    "file": "SUkqAL42BADHwpjCvZPHwpjMx53..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "B0laK.tif",
    "link": null,
    "width": null,
    "height": null,
    "fileSize": 276466,
    "fileId": "ST01FT200923042741078O6erQ9zF3fO",
    "name": "B0laK.tif",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FT200923042741078O6erQ9zF3fO",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.169Z",
    "dateUpdated": "2020-09-23T03:27:41.169Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'SUkqAL42BADHwpjCvZPHwpjMx53...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

TIFF 업로드

Sample Request

{
    "file": "SUkqAOT2DgDW397a4+Le5+bd5uX..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "QObmC.tif",
    "link": null,
    "width": null,
    "height": null,
    "fileSize": 980964,
    "fileId": "ST01FT2009230427412489DZaWmy82cf",
    "name": "QObmC.tif",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FT2009230427412489DZaWmy82cf",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.393Z",
    "dateUpdated": "2020-09-23T03:27:41.393Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'SUkqAOT2DgDW397a4+Le5+bd5uX...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

GIF 업로드

Sample Request

{
    "file": "R0lGODlh6gEGAuZzAAAAAAAACAA..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "paypM.gif",
    "link": null,
    "width": 490,
    "height": 518,
    "fileSize": 62704,
    "fileId": "ST01FG200923042741415GifBHVs5QAQ",
    "name": "paypM.gif",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FG200923042741415GifBHVs5QAQ",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.482Z",
    "dateUpdated": "2020-09-23T03:27:41.482Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'R0lGODlh6gEGAuZzAAAAAAAACAA...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

PDF 업로드

Sample Request

{
    "file": "JVBERi0xLjMNCiXi48/TDQoNCjE..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "TTHPG.pdf",
    "link": null,
    "width": null,
    "height": null,
    "fileSize": 3028,
    "fileId": "ST01FF200923042741496zMm1zX3D9CF",
    "name": "TTHPG.pdf",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FF200923042741496zMm1zX3D9CF",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.571Z",
    "dateUpdated": "2020-09-23T03:27:41.571Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'JVBERi0xLjMNCiXi48/TDQoNCjE...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

1MB 파일 업로드

Sample Request

{
    "file": "/9j/4REPRXhpZgAATU0AKgAAAAg..."
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "DOCUMENT",
    "originalName": "flbK7.jpg",
    "link": null,
    "width": 3506,
    "height": 2329,
    "fileSize": 1420596,
    "fileId": "ST01FJ200923042741654mQT8ciQddW4",
    "name": "flbK7.jpg",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FJ200923042741654mQT8ciQddW4",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.793Z",
    "dateUpdated": "2020-09-23T03:27:41.793Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: '/9j/4REPRXhpZgAATU0AKgAAAAg...'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

200 KB 이하 JPG 업로드 (MMS)

Sample Request

{
    "file": "/9j/4AAQSkZJRgABAQEBLAEsAAD...",
    "name": "Kakao1",
    "type": "MMS"
}

Sample Response

{
    "kakao": {
        "daou": null,
        "biztalk": null
    },
    "type": "MMS",
    "originalName": "Kakao1",
    "link": null,
    "width": 689,
    "height": 689,
    "fileSize": 102796,
    "fileId": "ST01FJ200923042741823JWUFVdPhVO4",
    "name": "-mr0d.jpg",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FJ200923042741823JWUFVdPhVO4",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:41.867Z",
    "dateUpdated": "2020-09-23T03:27:41.867Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: '/9j/4AAQSkZJRgABAQEBLAEsAAD...',
    name: 'Kakao1',
    type: 'MMS'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

PNG 업로드 (카카오)

Sample Request

{
    "file": "iVBORw0KGgoAAAANSUhEUgAAAyA...",
    "name": "Kakao1",
    "link": "https://solapi.com",
    "type": "KAKAO"
}

Sample Response

{
    "kakao": {
        "daou": "http://mud-kage.kakao.com/dn/FQKZu/btqytT1XOEk/0f5vpzODWOuTvO8iW4wfwk/testImage.png",
        "biztalk": "http://mud-kage.kakao.com/dn/FQKZu/btqytT1XOEk/0f5vpzODWOuTvO8iW4wfwk/testImage.png"
    },
    "type": "KAKAO",
    "originalName": "Kakao1",
    "link": "https://solapi.com",
    "width": 800,
    "height": 500,
    "fileSize": 503111,
    "fileId": "ST01FP200923042741925j2vNaEg0l8N",
    "name": "T6PSV.png",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FP200923042741925j2vNaEg0l8N",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:42.091Z",
    "dateUpdated": "2020-09-23T03:27:42.091Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: 'iVBORw0KGgoAAAANSUhEUgAAAyA...',
    name: 'Kakao1',
    link: 'https://solapi.com',
    type: 'KAKAO'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

JPEG 업로드 (카카오)

Sample Request

{
    "file": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
    "name": "Kakao1",
    "link": "https://solapi.com",
    "type": "KAKAO"
}

Sample Response

{
    "kakao": {
        "daou": "http://mud-kage.kakao.com/dn/FQKZu/btqytT1XOEk/0f5vpzODWOuTvO8iW4wfwk/testImage.png",
        "biztalk": null
    },
    "type": "KAKAO",
    "originalName": "Kakao1",
    "link": "https://solapi.com",
    "width": 629,
    "height": 436,
    "fileSize": 127596,
    "fileId": "ST01FJ200923042742110Q47kaX6t7u9",
    "name": "D_ccI.jpg",
    "url": "https://coolsms-storage-test.s3.ap-northeast-2.amazonaws.com/53901839183913/ST01FJ200923042742110Q47kaX6t7u9",
    "accountId": "53901839183913",
    "references": [],
    "dateCreated": "2020-09-23T03:27:42.196Z",
    "dateUpdated": "2020-09-23T03:27:42.196Z"
}

Sample Code

var request = require('request');

var options = {
  headers: {
    Authorization:
      'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
    'Content-Type': 'application/json'
  },
  body: {
    file: '/9j/4AAQSkZJRgABAQAAAQABAAD...',
    name: 'Kakao1',
    link: 'https://solapi.com',
    type: 'KAKAO'
  },
  method: 'POST',
  json: true,
  url: 'http://api.solapi.com/storage/v1/files'
};

request(options, function(error, response, body) {
  if (error) throw error;
  console.log('result :', body);
});

문서 생성일 : 2020-09-23

Last updated