국가별 메시지 가격 리스트 가져오기

Request

1
GET https://api.coolsms.co.kr/pricing/v1/messaging/countries
Copied!
로그인한 계정의 국가별 메시지 가격 리스트를 가져옵니다. (로그인 안하면 기본 단가)

Query Params

Name
Type
Required
Allowed Operator [?]
Description
countryId
string
eq
국가 코드
offset
number
eq
시작점
limit
number
eq
조회할 개수

Samples

getMessagePriceList.spec.js

Sample Request
1
http://api.coolsms.co.kr/pricing/v1/messaging/countries
Copied!
Sample Response
1
[
2
{
3
"countryName": "Korea, South",
4
"countryId": "82",
5
"sms": 20,
6
"lms": 50,
7
"mms": 200,
8
"ata": 19,
9
"cta": 13,
10
"cti": 20,
11
"dateCreated": "2019-10-28T18:03:40.761Z",
12
"dateUpdated": "2019-10-28T18:03:40.761Z"
13
},
14
{
15
"countryName": "Lithuania",
16
"countryId": "370",
17
"sms": 94,
18
"lms": 500,
19
"mms": 1000,
20
"ata": 19,
21
"cta": 13,
22
"cti": 20,
23
"dateCreated": "2019-10-28T18:03:40.760Z",
24
"dateUpdated": "2019-10-28T18:03:40.760Z"
25
},
26
{
27
"countryName": "Turkmenistan",
28
"countryId": "993",
29
"sms": 94,
30
"lms": 500,
31
"mms": 1000,
32
"ata": 19,
33
"cta": 13,
34
"cti": 20,
35
"dateCreated": "2019-10-28T18:03:40.758Z",
36
"dateUpdated": "2019-10-28T18:03:40.758Z"
37
},
38
{
39
"countryName": "Sao Tome and Principe",
40
"countryId": "239",
41
"sms": 271,
42
"lms": 500,
43
"mms": 1000,
44
"ata": 19,
45
"cta": 13,
46
"cti": 20,
47
"dateCreated": "2019-10-28T18:03:40.757Z",
48
"dateUpdated": "2019-10-28T18:03:40.757Z"
49
},
50
{
51
"countryName": "East Timor",
52
"countryId": "670",
53
"sms": 180,
54
"lms": 500,
55
"mms": 1000,
56
"ata": 19,
57
"cta": 13,
58
"cti": 20,
59
"dateCreated": "2019-10-28T18:03:40.755Z",
60
"dateUpdated": "2019-10-28T18:03:40.755Z"
61
}
62
]
Copied!
Sample Code
NODE
JQUERY
PHP
PYTHON
CURL
RUBY
GO
JAVA
1
var request = require('request');
2
3
var options = {
4
method: 'GET',
5
json: true,
6
url: 'http://api.coolsms.co.kr/pricing/v1/messaging/countries'
7
};
8
9
request(options, function(error, response, body) {
10
if (error) throw error;
11
console.log('result :', body);
12
});
Copied!
1
var options = {
2
method: 'GET',
3
url: 'http://api.coolsms.co.kr/pricing/v1/messaging/countries'
4
};
5
6
$.ajax(options).done(function(response) {
7
console.log(response);
8
});
Copied!
1
<?php
2
$url = "http://api.coolsms.co.kr/pricing/v1/messaging/countries";
3
4
$options = array(
5
'http' => array(
6
'header' => ,
7
'method' => 'GET'
8
)
9
);
10
11
$context = stream_context_create($options);
12
$result = file_get_contents($url, false, $context);
13
14
var_dump($result);
Copied!
1
import requests
2
3
url = "http://api.coolsms.co.kr/pricing/v1/messaging/countries"
4
5
response = requests.get(url)
6
print(response.status_code)
7
print(response.text)
Copied!
1
#!/bin/bash
2
curl -X GET \
3
http://api.coolsms.co.kr/pricing/v1/messaging/countries
Copied!
1
require 'net/http'
2
require 'uri'
3
require 'json'
4
5
uri = URI.parse("http://api.coolsms.co.kr/pricing/v1/messaging/countries")
6
7
http = Net::HTTP.new(uri.host, uri.port)
8
request = Net::HTTP::Get.new(uri.request_uri, )
9
10
response = http.request(request)
11
puts response.code
12
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.coolsms.co.kr/pricing/v1/messaging/countries"
12
13
req, err := http.NewRequest("GET", uri, nil)
14
if err != nil { panic(err) }
15
16
client := &http.Client{}
17
resp, err := client.Do(req)
18
if err != nil { panic(err) }
19
defer resp.Body.Close()
20
21
bytes, _ := ioutil.ReadAll(resp.Body)
22
str := string(bytes)
23
fmt.Println(str)
24
}
Copied!
1
package coolsms;
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.coolsms.co.kr/pricing/v1/messaging/countries";
12
13
URL url = new URL(targetUrl);
14
HttpURLConnection con = (HttpURLConnection) url.openConnection();
15
16
con.setRequestMethod("GET");
17
18
19
con.setDoOutput(true);
20
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
21
wr.writeBytes(parameters);
22
wr.flush();
23
wr.close();
24
25
int responseCode = con.getResponseCode();
26
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
27
String line;
28
StringBuffer response = new StringBuffer();
29
while ((line = in.readLine()) != null) {
30
response.append(line);
31
}
32
in.close();
33
34
System.out.println("HTTP response code : " + responseCode);
35
System.out.println("HTTP body : " + response.toString());
36
}
37
}
Copied!
문서 생성일 : 2019-10-28
Last modified 1yr ago