SOLAPI
Search…
발신번호 업데이트

Request

1
PUT https://api.solapi.com/senderid/v1/numbers/:phoneNumber
Copied!
발신번호 상태를 'ACTIVE'에서 'INACTIVE' 혹은 'INACTIVE' 에서 'ACTIVE'로 변경합니다.

Authorization 인증 필요 [?]

계정 권한
회원 권한
계정 상태
회원 상태
계정 인증
senderid:read
role-senderid:read

Path Parameters

Name
Description
:phoneNumber
핸드폰 번호

Request Structure

1
{
2
"status": "string"
3
}
Copied!

Body Params

Name
Type
Required
Description
status
string
O
상태값

Samples

updateSenderId.spec.js

Sample Request
1
{
2
"status": "INACTIVE"
3
}
Copied!
Sample Response
1
{
2
"limit": 2,
3
"accountId": "12925149",
4
"senderIds": [
5
{
6
"unlockDuplicate": {
7
"duplicateId": null,
8
"reason": null,
9
"reasonForRequested": null,
10
"name": null,
11
"status": null,
12
"dateCreated": null,
13
"dateUpdated": null
14
},
15
"status": "INACTIVE",
16
"expireAt": null,
17
"method": null,
18
"log": [
19
{
20
"createAt": "2019-10-28T17:59:25.457Z",
21
"message": "발신번호 상태를 'INACTIVE'로 변경하였습니다."
22
}
23
],
24
"dateCreated": "2019-10-28T17:59:25.446Z",
25
"dateUpdated": "2019-10-28T17:59:25.457Z",
26
"approvalDocuments": [],
27
"handleKey": "SED20181030105615MMXDST163SYMMX2",
28
"phoneNumber": "01000000000"
29
},
30
{
31
"unlockDuplicate": {
32
"duplicateId": null,
33
"reason": null,
34
"reasonForRequested": null,
35
"name": null,
36
"status": null,
37
"dateCreated": null,
38
"dateUpdated": null
39
},
40
"status": "PENDING",
41
"expireAt": null,
42
"method": null,
43
"log": [],
44
"dateCreated": "2019-10-28T17:59:25.445Z",
45
"dateUpdated": "2019-10-28T17:59:25.445Z",
46
"approvalDocuments": [],
47
"handleKey": "SED20181030105615MMXDST163SYMMX3",
48
"phoneNumber": "01000000001"
49
}
50
],
51
"limitationDocuments": [],
52
"dateCreated": "2019-10-28T17:59:25.446Z",
53
"dateUpdated": "2019-10-28T17:59:25.457Z"
54
}
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
status: 'INACTIVE'
11
},
12
method: 'PUT',
13
json: true,
14
url: 'http://api.solapi.com/senderid/v1/numbers/01000000000'
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
status: 'INACTIVE'
9
},
10
method: 'PUT',
11
url: 'http://api.solapi.com/senderid/v1/numbers/01000000000'
12
};
13
14
$.ajax(options).done(function(response) {
15
console.log(response);
16
});
Copied!
1
<?php
2
$url = "http://api.solapi.com/senderid/v1/numbers/01000000000";
3
$data = '{"status":"INACTIVE"}';
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' => 'PUT'
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/numbers/01000000000"
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 = '{"status":"INACTIVE"}'
9
10
response = requests.put(url, headers=headers, data=data)
11
print(response.status_code)
12
print(response.text)
Copied!
1
#!/bin/bash
2
curl -X PUT \
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 '{"status":"INACTIVE"}' \
6
http://api.solapi.com/senderid/v1/numbers/01000000000
Copied!
1
require 'net/http'
2
require 'uri'
3
require 'json'
4
5
uri = URI.parse("http://api.solapi.com/senderid/v1/numbers/01000000000")
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
"status": "INACTIVE"
13
}
14
http = Net::HTTP.new(uri.host, uri.port)
15
request = Net::HTTP::Put.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/numbers/01000000000"
12
data := strings.NewReader(`{"status":"INACTIVE"}`)
13
14
req, err := http.NewRequest("PUT", 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/numbers/01000000000";
12
String parameters = "{\"status\":\"INACTIVE\"}";
13
14
URL url = new URL(targetUrl);
15
HttpURLConnection con = (HttpURLConnection) url.openConnection();
16
17
con.setRequestMethod("PUT");
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