SOLAPI
Search…
문서 삭제

Request

1
DELETE https://api.solapi.com/senderid/v1/documents
Copied!
발신번호 관련 문서를 삭제합니다.

Authorization 인증 필요 [?]

계정 권한
회원 권한
계정 상태
회원 상태
계정 인증
senderid:write
role-senderid:write
ACTIVE
ACTIVE
O

Request Structure

1
{
2
"documents": "Array"
3
}
Copied!

Body Params

Name
Type
Required
Description
documents
Array
O
문서 ID 목록

Samples

deleteDocuments.spec.js

Sample Request
1
{
2
"documents": [
3
"DOC20181030105615MMXDST163SYMMX3"
4
]
5
}
Copied!
Sample Response
1
[
2
{
3
"use": false,
4
"documentId": "DOC20181030105615MMXDST163SYMMX3",
5
"accountId": "12925149",
6
"name": "qYQyBQ3Va5CQIOu.png",
7
"url": "https://coolsms-files-test.s3.ap-northeast-2.amazonaws.com/senderId-approval/qYQyBQ3Va5CQIOu.png",
8
"originalName": "qYQyBQ3Va5CQIOu.png",
9
"category": "SENDERID_APPROVAL",
10
"dateCreated": "2019-10-28T17:59:26.962Z"
11
}
12
]
Copied!
Sample Code
NODE
JQUERY
PHP
PYTHON
CURL
RUBY
GO
JAVA
1
var request = require('request');
2
3
var options = {
4
headers: {
5
Authorization:
6
'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
7
'Content-Type': 'application/json'
8
},
9
body: {
10
documents: 'DOC20181030105615MMXDST163S...'
11
},
12
method: 'DELETE',
13
json: true,
14
url: 'http://api.solapi.com/senderid/v1/documents'
15
};
16
17
request(options, function(error, response, body) {
18
if (error) throw error;
19
console.log('result :', body);
20
});
Copied!
1
var options = {
2
headers: {
3
Authorization:
4
'HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4',
5
'Content-Type': 'application/json'
6
},
7
body: {
8
documents: 'DOC20181030105615MMXDST163S...'
9
},
10
method: 'DELETE',
11
url: 'http://api.solapi.com/senderid/v1/documents'
12
};
13
14
$.ajax(options).done(function(response) {
15
console.log(response);
16
});
Copied!
1
<?php
2
$url = "http://api.solapi.com/senderid/v1/documents";
3
$data = '{"documents":"DOC20181030105615MMXDST163S..."}';
4
5
$options = array(
6
'http' => array(
7
'header' => "Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4\r\n" . "Content-Type: application/json\r\n",
8
'content' => $data,
9
'method' => 'DELETE'
10
)
11
);
12
13
$context = stream_context_create($options);
14
$result = file_get_contents($url, false, $context);
15
16
var_dump($result);
Copied!
1
import requests
2
3
url = "http://api.solapi.com/senderid/v1/documents"
4
headers = {
5
"Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
6
"Content-Type": "application/json"
7
}
8
data = '{"documents":"DOC20181030105615MMXDST163S..."}'
9
10
response = requests.delete(url, headers=headers, data=data)
11
print(response.status_code)
12
print(response.text)
Copied!
1
#!/bin/bash
2
curl -X DELETE \
3
-H 'Authorization: HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4' \
4
-H 'Content-Type: application/json' \
5
-d '{"documents":"DOC20181030105615MMXDST163S..."}' \
6
http://api.solapi.com/senderid/v1/documents
Copied!
1
require 'net/http'
2
require 'uri'
3
require 'json'
4
5
uri = URI.parse("http://api.solapi.com/senderid/v1/documents")
6
7
headers = {
8
"Authorization": "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4",
9
"Content-Type": "application/json"
10
}
11
data = {
12
"documents": "DOC20181030105615MMXDST163S..."
13
}
14
http = Net::HTTP.new(uri.host, uri.port)
15
request = Net::HTTP::Delete.new(uri.request_uri, headers)
16
request.body = data.to_json
17
18
response = http.request(request)
19
puts response.code
20
puts response.body
Copied!
1
package main
2
3
import (
4
"fmt"
5
"io/ioutil"
6
"net/http"
7
"strings"
8
)
9
10
func main() {
11
uri := "http://api.solapi.com/senderid/v1/documents"
12
data := strings.NewReader(`{"documents":"DOC20181030105615MMXDST163S..."}`)
13
14
req, err := http.NewRequest("DELETE", uri, data)
15
if err != nil { panic(err) }
16
17
req.Header.Set("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4")
18
req.Header.Set("Content-Type", "application/json")
19
20
client := &http.Client{}
21
resp, err := client.Do(req)
22
if err != nil { panic(err) }
23
defer resp.Body.Close()
24
25
bytes, _ := ioutil.ReadAll(resp.Body)
26
str := string(bytes)
27
fmt.Println(str)
28
}
Copied!
1
package solapi;
2
3
import java.io.BufferedReader;
4
import java.io.DataOutputStream;
5
import java.io.InputStreamReader;
6
import java.net.HttpURLConnection;
7
import java.net.URL;
8
9
public class Request {
10
public static void main(String[] args) throws Exception {
11
String targetUrl = "http://api.solapi.com/senderid/v1/documents";
12
String parameters = "{\"documents\":\"DOC20181030105615MMXDST163S...\"}";
13
14
URL url = new URL(targetUrl);
15
HttpURLConnection con = (HttpURLConnection) url.openConnection();
16
17
con.setRequestMethod("DELETE");
18
19
con.setRequestProperty("Authorization", "HMAC-SHA256 apiKey=NCSAYU7YDBXYORXC, date=2019-07-01T00:41:48Z, salt=jqsba2jxjnrjor, signature=1779eac71a24cbeeadfa7263cb84b7ea0af1714f5c0270aa30ffd34600e363b4");
20
con.setRequestProperty("Content-Type", "application/json");
21
22
con.setDoOutput(true);
23
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
24
wr.writeBytes(parameters);
25
wr.flush();
26
wr.close();
27
28
int responseCode = con.getResponseCode();
29
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
30
String line;
31
StringBuffer response = new StringBuffer();
32
while ((line = in.readLine()) != null) {
33
response.append(line);
34
}
35
in.close();
36
37
System.out.println("HTTP response code : " + responseCode);
38
System.out.println("HTTP body : " + response.toString());
39
}
40
}
Copied!
문서 생성일 : 2019-10-28
Last modified 1yr ago