> For the complete documentation index, see [llms.txt](https://nurigo.gitbook.io/solapi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nurigo.gitbook.io/solapi/api-reference/storage/uploadfile.md).

# 파일 업로드

## Request

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

파일을 업로드합니다.

타입별 제한 사이즈

* \[KAKAO] : 500KB
* \[MMS] : 200KB
* \[DOCUMENT] : 2MB

### Authorization 인증 필요 [\[?\]](https://docs.solapi.com/authentication/overview#authorization)

| 계정 권한           | 회원 권한 | 계정 상태    | 회원 상태    | 계정 인증 |
| --------------- | ----- | -------- | -------- | :---: |
| `storage:write` |       | `ACTIVE` | `ACTIVE` |       |

### Request Structure

```javascript
{
    "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

```javascript
{
    "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                  |
| ------------------------------------------------------------------- | :------: | :-----------: | ---------------------------- |
| [kakao](/solapi/api-reference/storage/uploadfile.md#response-kakao) | `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**

```javascript
{
    "file": "iVBORw0KGgoAAAANSUhEUgAAAyA..."
}
```

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "iVBORw0KGgoAAAANSUhEUgAAAyA..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"iVBORw0KGgoAAAANSUhEUgAAAyA...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### PNG 업로드 (이름 포함)

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"smile.png"}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"smile.png"}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "iVBORw0KGgoAAAANSUhEUgAAAyA...",
  "name": "smile.png"
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"smile.png"}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"iVBORw0KGgoAAAANSUhEUgAAAyA...\",\"name\":\"smile.png\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### JPG 업로드

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"/9j/4AAQSkZJRgABAQAAAQABAAD...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### JPEG 업로드

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "/9j/4AAQSkZJRgABAQAAAQABAAD..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"/9j/4AAQSkZJRgABAQAAAQABAAD...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### TIF 업로드

> **Sample Request**

```javascript
{
    "file": "SUkqAL42BADHwpjCvZPHwpjMx53..."
}
```

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"SUkqAL42BADHwpjCvZPHwpjMx53..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"SUkqAL42BADHwpjCvZPHwpjMx53..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "SUkqAL42BADHwpjCvZPHwpjMx53..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"SUkqAL42BADHwpjCvZPHwpjMx53..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"SUkqAL42BADHwpjCvZPHwpjMx53...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### TIFF 업로드

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"SUkqAOT2DgDW397a4+Le5+bd5uX..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"SUkqAOT2DgDW397a4+Le5+bd5uX..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "SUkqAOT2DgDW397a4+Le5+bd5uX..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"SUkqAOT2DgDW397a4+Le5+bd5uX..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"SUkqAOT2DgDW397a4+Le5+bd5uX...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### GIF 업로드

> **Sample Request**

```javascript
{
    "file": "R0lGODlh6gEGAuZzAAAAAAAACAA..."
}
```

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"R0lGODlh6gEGAuZzAAAAAAAACAA..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"R0lGODlh6gEGAuZzAAAAAAAACAA..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "R0lGODlh6gEGAuZzAAAAAAAACAA..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"R0lGODlh6gEGAuZzAAAAAAAACAA..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"R0lGODlh6gEGAuZzAAAAAAAACAA...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### PDF 업로드

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"JVBERi0xLjMNCiXi48/TDQoNCjE..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"JVBERi0xLjMNCiXi48/TDQoNCjE..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "JVBERi0xLjMNCiXi48/TDQoNCjE..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"JVBERi0xLjMNCiXi48/TDQoNCjE..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"JVBERi0xLjMNCiXi48/TDQoNCjE...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### 1MB 파일 업로드

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"/9j/4REPRXhpZgAATU0AKgAAAAg..."}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"/9j/4REPRXhpZgAATU0AKgAAAAg..."}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "/9j/4REPRXhpZgAATU0AKgAAAAg..."
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"/9j/4REPRXhpZgAATU0AKgAAAAg..."}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"/9j/4REPRXhpZgAATU0AKgAAAAg...\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### 200 KB 이하 JPG 업로드 (MMS)

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"/9j/4AAQSkZJRgABAQEBLAEsAAD...","name":"Kakao1","type":"MMS"}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"/9j/4AAQSkZJRgABAQEBLAEsAAD...","name":"Kakao1","type":"MMS"}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "/9j/4AAQSkZJRgABAQEBLAEsAAD...",
  "name": "Kakao1",
  "type": "MMS"
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"/9j/4AAQSkZJRgABAQEBLAEsAAD...","name":"Kakao1","type":"MMS"}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"/9j/4AAQSkZJRgABAQEBLAEsAAD...\",\"name\":\"Kakao1\",\"type\":\"MMS\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### PNG 업로드 (카카오)

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "iVBORw0KGgoAAAANSUhEUgAAAyA...",
  "name": "Kakao1",
  "link": "https://solapi.com",
  "type": "KAKAO"
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"iVBORw0KGgoAAAANSUhEUgAAAyA...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"iVBORw0KGgoAAAANSUhEUgAAAyA...\",\"name\":\"Kakao1\",\"link\":\"https://solapi.com\",\"type\":\"KAKAO\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

### JPEG 업로드 (카카오)

> **Sample Request**

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

> **Sample Response**

```javascript
{
    "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**

{% tabs %}
{% tab title="NODE" %}

```javascript
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);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$url = "http://api.solapi.com/storage/v1/files";
$data = '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}';

$options = array(
    'http' => array(
        'header'  => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
        'content' => $data,
        'method'  => 'POST'
    )
);

$context  = stream_context_create($options);
$result = file_get_contents($url, false, $context);

var_dump($result);
```

{% endtab %}

{% tab title="PYTHON" %}

```python
import requests

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

response = requests.post(url, headers=headers, data=data)
print(response.status_code)
print(response.text)
```

{% endtab %}

{% tab title="CURL" %}

```
#!/bin/bash
curl -X POST \
    -H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
    -H 'Content-Type: application/json' \
    -d '{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}' \
    http://api.solapi.com/storage/v1/files
```

{% endtab %}

{% tab title="RUBY" %}

```ruby
require 'net/http'
require 'uri'
require 'json'

uri = URI.parse("http://api.solapi.com/storage/v1/files")

headers = {
  "Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
  "Content-Type": "application/json"
}
data = {
  "file": "/9j/4AAQSkZJRgABAQAAAQABAAD...",
  "name": "Kakao1",
  "link": "https://solapi.com",
  "type": "KAKAO"
}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, headers)
request.body = data.to_json

response = http.request(request)
puts response.code
puts response.body
```

{% endtab %}

{% tab title="GO" %}

```go
package main

import (
  "fmt"
  "io/ioutil"
  "net/http"
  "strings"
)

func main() {
  uri := "http://api.solapi.com/storage/v1/files"
  data := strings.NewReader(`{"file":"/9j/4AAQSkZJRgABAQAAAQABAAD...","name":"Kakao1","link":"https://solapi.com","type":"KAKAO"}`)

  req, err := http.NewRequest("POST", uri, data)
  if err != nil { panic(err) }

  req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
  req.Header.Set("Content-Type", "application/json")

  client := &http.Client{}
  resp, err := client.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()

  bytes, _ := ioutil.ReadAll(resp.Body)
  str := string(bytes)
  fmt.Println(str)
}
```

{% endtab %}

{% tab title="JAVA" %}

```java
package solapi;

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Request {
  public static void main(String[] args) throws Exception {
    String targetUrl = "http://api.solapi.com/storage/v1/files";
    String parameters = "{\"file\":\"/9j/4AAQSkZJRgABAQAAAQABAAD...\",\"name\":\"Kakao1\",\"link\":\"https://solapi.com\",\"type\":\"KAKAO\"}";

    URL url = new URL(targetUrl);
    HttpURLConnection con = (HttpURLConnection) url.openConnection();

    con.setRequestMethod("POST");

    con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
    con.setRequestProperty("Content-Type", "application/json");

    con.setDoOutput(true);
    DataOutputStream wr = new DataOutputStream(con.getOutputStream());
    wr.writeBytes(parameters);
    wr.flush();
    wr.close();

    int responseCode = con.getResponseCode();
    BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line;
    StringBuffer response = new StringBuffer();
    while ((line = in.readLine()) != null) {
      response.append(line);
    }
    in.close();

    System.out.println("HTTP response code : " + responseCode);
    System.out.println("HTTP body : " + response.toString());
  }
}
```

{% endtab %}
{% endtabs %}

> 문서 생성일 : 2020-09-23
