가비아의 개발 노하우로
API를 제공합니다

API 개발 가이드

  • API 사용 첫 단계
  • 메시징을 이용하기 전, 발송 IP와 발신 번호 등록 및 API Key를 확인하세요.

API 연동 방법 선택

연동 방법

가비아 메시징(SMS) 서비스는 다양한 API 프로토콜을 제공하기 위해 ‘XML RPC’ 와 ‘REST API’, 두 가지 API 연동 방식을 지원합니다.

1. XML RPC(구 API)

  • - 단문/장문/포토 발송 가능
  • - 제공 언어: JSP, PHP, ASP, ASP.NET
  • - 모듈 및 이용 가이드 다운로드

XML RPC 모듈 다운로드설치 및 이용 매뉴얼 다운로드

2. REST API

  • - 단문/장문/포토/국제(단문) 발송 가능
  • - 제공 언어: PHP, JAVA, PYTHON, NODE, RUBY, cURL, GO
  • - 하단의 이용 매뉴얼 참고
  • 사용자 인증
  • SMS ID와 API Key로 토큰을 발행해 사용자를 인증합니다.
  • - 사용자 인증 단계에서만, Authroization에 'API_ KEY' 값을 넣어주세요.
  • POST https://sms.gabia.com/oauth/token
  • HEADERS
  • Content-Type application/x-www-form-urlencoded
    Authorization Basic base64encode(SMS_ID:API_KEY)
    (예) Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ=
  • BODY
  • grant_type client_credentials
  • RESPONSE
  • 성공케이스 {
    "access_token": "your_access_token",
    "refresh_token": "your_refresh_token",
    "expires_in": 3600,
    "scope": "basic",
    "create_on": "2022-01-01 00:00:01",
    "is_expires": "N",
    "token_type": "basic",
    "code": "basic"
    }
    실패케이스 {"message": "SMS ID나 API KEY가 잘못되었습니다."}
    {"message": "unsupported_grant_type (grant_type 값을 확인해주세요.)"}
    * Authorization 값 확인이 안 되는 경우, {"message": "client_id empty"} 또는 {"message": "client_secret empty"}가 출력됩니다.
    sms_id:api_key 형태로 base64인코딩 규격을 맞춰주세요.
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/oauth/token",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "POST",
                          CURLOPT_POSTFIELDS => "grant_type=client_credentials",
                          CURLOPT_HTTPHEADER => array(
                          "Content-Type: application/x-www-form-urlencoded",
                          "Authorization: Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.MultipartBody;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.RequestBody;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class userAuth {
                          public static final String SMS_OAUTH_TOKEN_URL = "https://sms.gabia.com/oauth/token"; // ACCESS
                          TOKEN 발급 API URL 입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String apiKey = "YOUR_API_KEY"; // SMS 관리툴에서 발급받은 API KEY 를 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          apiKey).getBytes(StandardCharsets.UTF_8)); // Authorization Header 에 입력할 값입니다.
    
                          // 사용자 인증 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM)
                          .addFormDataPart("grant_type", "client_credentials")
                          .build();
    
                          Request request = new Request.Builder()
                          .url(SMS_OAUTH_TOKEN_URL)
                          .post(requestBody)
                          .addHeader("Content-Type", "application/x-www-form-urlencoded")
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          Response response = client.newCall(request).execute();
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/oauth/token'
                          payload = 'grant_type=client_credentials'
                          headers = {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Authorization': 'Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ='
                          }
                          response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var qs = require('querystring');
    
                          var postData = qs.stringify({
                          'grant_type': 'client_credentials'
                          });
    
                          var options = {
                          method: 'POST',
                          hostname: 'sms.gabia.com',
                          path: '/oauth/token',
                          headers: {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Content-Length': Buffer.byteLength(postData),
                          'Authorization': 'Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          req.write(postData);
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/oauth/token")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Post.new(url)
                          request["Content-Type"] = "application/x-www-form-urlencoded"
                          request["Authorization"] = "Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ="
                          request.body = "grant_type=client_credentials"
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request POST
                          "https://sms.gabia.com/oauth/token" \
                          --header "Content-Type: application/x-www-form-urlencoded" \
                          --header "Authorization: Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ=" \
                          --data "grant_type=client_credentials"
    package main
    
                          import (
                          "fmt"
                          "strings"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/oauth/token"
                          method := "POST"
    
                          payload := strings.NewReader("grant_type=client_credentials")
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, payload)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
                          req.Header.Add("Authorization", "Basic c1hY3JvY2sZDAwNzA2YzJlMTdjZjlkMz1234hlM2U5YjQ=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 단문(SMS) 발송 하기
  • 단문으로 문자를 발송할 수 있습니다. 90byte까지 단문으로 발송되며, 90byte가 넘는 경우에는 단문으로 잘려 발송됩니다.
  • - 문자 발송 시(SMS, LMS, MMS 모두 포함) Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • POST https://sms.gabia.com/api/send/sms
  • HEADERS
  • Content-Type application/x-www-form-urlencoded
    Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) Basic DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • BODY
  • phone 01000000000
    callback 15444370
    message SMS TEST MESSAGE
    refkey RESTAPITEST1549847130
    Any unique string to find your result of send after
    is_foreign
    (국제 문자 발송 시)
    Y
    국제 번호로 문자 발송을 원하는 경우, 해당 값을 Y로 넣어 주세요.
    국제 문자 발송은 단문(SMS)만 지원하며, 발송 시 6건이 차감됩니다.
  • RESPONSE
  • 성공케이스 {
    "code": "200",
    "message": "Success",
    "data": {
    "BEFORE_SMS_QTY": "발송 전 메시지 잔여량",
    "AFTER_SMS_QTY": "발송 후 메시지 잔여량",
    "INSERT_ID": "0000000"
    }
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/send/sms",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "POST",
                          CURLOPT_POSTFIELDS =>
                          "phone=01000000000&callback=15444370&message=SMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]",
                          CURLOPT_HTTPHEADER => array(
                          "Content-Type: application/x-www-form-urlencoded",
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.MultipartBody;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.RequestBody;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class sendSMS {
                          public static final String SMS_SEND_URL = "https://sms.gabia.com/api/send/sms"; // SMS 발송 API URL
                          입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          accessToken).getBytes(StandardCharsets.UTF_8)); // Authorization Header 에 입력할 값입니다.
    
                          // SMS 발송 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM)
                          .addFormDataPart("phone", "RECEIPT_PHONE_NUMBER") // 수신번호를 입력해 주세요. (수신번호가 두 개 이상인 경우 ',' 를 이용하여
                          입력합니다. ex) 01011112222,01033334444)
                          .addFormDataPart("callback", "CALLING_PHONE_NUMBER") // 발신번호를 입력해 주세요.
                          .addFormDataPart("message", "SMS_CONTENT") // SMS 내용을 입력해 주세요.
                          .addFormDataPart("refkey", "YOUR_REF_KEY") // 발송 결과 조회를 위한 임의의 랜덤 키 값을 입력해 주세요.
                          .build();
    
                          Request request = new Request.Builder()
                          .url(SMS_SEND_URL)
                          .post(requestBody)
                          .addHeader("Content-Type", "application/x-www-form-urlencoded")
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          Response response = client.newCall(request).execute();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/api/send/sms'
                          payload =
                          'phone=01000000000&callback=15444370&message=SMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]'
                          headers = {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var qs = require('querystring');
    
                          var options = {
                          'method': 'POST',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/send/sms',
                          'headers': {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          var postData = qs.stringify({
                          'phone': '01000000000',
                          'callback': '15444370',
                          'message': 'SMS TEST MESSAGE',
                          'refkey': 'RESTAPITEST1547771538'
                          });
    
                          req.write(postData);
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/send/sms")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Post.new(url)
                          request["Content-Type"] = "application/x-www-form-urlencoded"
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          request.body =
                          "phone=01000000000&callback=15444370&message=SMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]"
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request POST
                          "https://sms.gabia.com/api/send/sms" \
                          --header "Content-Type: application/x-www-form-urlencoded" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          \
                          --data
                          "phone=01000000000&callback=15444370&message=SMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]"
                        
    package main
    
                          import (
                          "fmt"
                          "strings"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/send/sms"
                          method := "POST"
    
                          payload :=
                          strings.NewReader("phone=01000000000&callback=15444370&message=SMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]")
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, payload)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 장문(LMS) 발송 하기
  • 장문으로 문자를 발송할 수 있습니다. 문자 내용에 제목을 추가할 수 있습니다.
  • - 문자 발송 시(SMS, LMS, MMS 모두 포함) Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • POST https://sms.gabia.com/api/send/lms
  • HEADERS
  • Content-Type application/x-www-form-urlencoded
    Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) Basic DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • BODY
  • phone 01000000000
    callback 15444370
    message LMS TEST MESSAGE
    refkey RESTAPITEST1549847130
    Any unique string to find your result of send after
    subject LMS TEST SUBJECT
  • RESPONSE
  • 성공케이스 {
    "code": "200",
    "message": "Success",
    "data": {
    "BEFORE_SMS_QTY": "발송 전 메시지 잔여량",
    "AFTER_SMS_QTY": "발송 후 메시지 잔여량",
    "INSERT_ID": "0000000"
    }
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/send/lms",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "POST",
                          CURLOPT_POSTFIELDS =>
                          "phone=01000000000&callback=15444370&message=LMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]&subject=LMS TEST SUBJECT",
                          CURLOPT_HTTPHEADER => array(
                          "Content-Type: application/x-www-form-urlencoded",
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.MultipartBody;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.RequestBody;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class sendLMS {
                          public static final String LMS_SEND_URL = "https://sms.gabia.com/api/send/lms"; // LMS 발송 API URL
                          입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          accessToken).getBytes(StandardCharsets.UTF_8)); // Authorization Header 에 입력할 값입니다.
    
                          // LMS 발송 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM)
                          .addFormDataPart("phone", "RECEIPT_PHONE_NUMBER") // 수신번호를 입력해 주세요. (수신번호가 두 개 이상인 경우 ',' 를 이용하여
                          입력합니다. ex) 01011112222,01033334444)
                          .addFormDataPart("callback", "CALLING_PHONE_NUMBER") // 발신번호를 입력해 주세요.
                          .addFormDataPart("message", "LMS_CONTENT") // LMS 내용을 입력해 주세요.
                          .addFormDataPart("refkey", "YOUR_REF_KEY") // 발송 결과 조회를 위한 임의의 랜덤 키 값을 입력해 주세요.
                          .addFormDataPart("subject", "LMS_TITLE") // LMS 제목을 입력해 주세요.
                          .build();
    
                          Request request = new Request.Builder()
                          .url(LMS_SEND_URL)
                          .post(requestBody)
                          .addHeader("Content-Type", "application/x-www-form-urlencoded")
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          Response response = client.newCall(request).execute();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/api/send/lms'
                          payload =
                          'phone=01000000000&callback=15444370&message=LMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]&subject=LMS TEST SUBJECT'
                          headers = {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var qs = require('querystring');
    
                          var options = {
                          'method': 'POST',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/send/lms',
                          'headers': {
                          'Content-Type': 'application/x-www-form-urlencoded',
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          var postData = qs.stringify({
                          'phone': '01000000000',
                          'callback': '15444370',
                          'message': 'LMS TEST MESSAGE',
                          'refkey': 'RESTAPITEST1547771538',
                          'subject': 'LMS TEST SUBJECT'
                          });
    
                          req.write(postData);
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/send/lms")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Post.new(url)
                          request["Content-Type"] = "application/x-www-form-urlencoded"
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          request.body =
                          "phone=01000000000&callback=15444370&message=LMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]&subject=LMS TEST SUBJECT"
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request POST
                          "https://sms.gabia.com/api/send/lms" \
                          --header "Content-Type: application/x-www-form-urlencoded" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          \
                          --data
                          "phone=01000000000&callback=15444370&message=LMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]&subject=LMS TEST SUBJECT"
                        
    package main
    
                          import (
                          "fmt"
                          "strings"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/send/lms"
                          method := "POST"
    
                          payload :=
                          strings.NewReader("phone=01000000000&callback=15444370&message=LMS TEST MESSAGE&refkey=[[RESTAPITEST1549847130]]&subject=LMS TEST SUBJECT")
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, payload)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 포토(MMS) 발송 하기
  • 단문/장문 문자에서 이미지를 첨부하여 발송할 수 있습니다. 이미지는 100kb 미만의 파일을 최대 3개까지 발송할 수 있으며, jpg 형식의 파일만 사용 가능합니다.
  • - 이미지 사이즈 규격은 수신자의 이통사에 따라 상이하므로 이통사별 규격을 참고해 주시기 바랍니다. (LG U+: 1500 X 1440 이하 / SKT: 1500 X 1500 이하 / KT: 2000 X 2000 이하)
    - 문자 발송 시(SMS, LMS, MMS 모두 포함) Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • POST https://sms.gabia.com/api/send/mms
  • HEADERS
  • Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) Basic DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • BODY
  • phone 01000000000
    callback 15444370
    message MMS TEST MESSAGE
    refkey RESTAPITEST1549847130
    Any unique string to find your result of send after
    subject MMS TEST SUBJECT
    image_cnt 2
    Max image count is 3. images0 ~ images2
    images0 File Resource
    images1 File Resource
  • RESPONSE
  • 성공케이스 {
    "code": "200",
    "message": "Success",
    "data": {
    "BEFORE_SMS_QTY": "발송 전 메시지 잔여량",
    "AFTER_SMS_QTY": "발송 후 메시지 잔여량",
    "INSERT_ID": "0000000"
    }
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/send/mms",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "POST",
                          CURLOPT_POSTFIELDS => array('phone' => '01000000000','callback' => '15444370','message' => 'MMS
                          TEST MESSAGE','refkey' => 'RESTAPITEST1548722798','subject' => 'MMS TEST SUBJECT','image_cnt' =>
                          '2','images0'=> new CURLFILE(''),'images1'=> new CURLFILE('')),
                          CURLOPT_HTTPHEADER => array(
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    package example.api;
    
    import com.google.gson.Gson;
    import java.io.File;
    import java.io.IOException;
    import java.nio.charset.StandardCharsets;
    import java.util.Base64;
    import java.util.HashMap;
    import java.util.Objects;
    import okhttp3.MultipartBody;
    import okhttp3.OkHttpClient;
    import okhttp3.Request;
    import okhttp3.RequestBody;
    import okhttp3.Response;
    
    // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
    // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
    https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
    // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
    public class sendMMS {
    public static final String MMS_SEND_URL = "https://sms.gabia.com/api/send/mms"; // MMS 발송 API URL
    입니다.
    
    public static void main(String[] args) throws IOException {
    String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
    String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
    String authValue =
    Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
    accessToken).getBytes(StandardCharsets.UTF_8));
    
    // MMS 발송 API 를 호출합니다.
    OkHttpClient client = new OkHttpClient();
    
    RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM)
    .addFormDataPart("phone", "RECEIPT_PHONE_NUMBER") // 수신번호를 입력해 주세요. (수신번호가 두 개 이상인 경우 ',' 를 이용하여
    입력합니다. ex) 01011112222,01033334444)
    .addFormDataPart("callback", "CALLING_PHONE_NUMBER") // 발신번호를 입력해 주세요.
    .addFormDataPart("message", "MMS_CONTENT") // MMS 내용을 입력해 주세요.
    .addFormDataPart("refkey", "YOUR_REF_KEY") // 발송 결과 조회를 위한 임의의 랜덤 키를 입력해 주세요.
    .addFormDataPart("subject", "MMS_TITLE") // MMS 제목을 입력해 주세요.
    .addFormDataPart("image_cnt", "1 ~ 3") // 이미지 첨부 개수를 입력해 주세요. (최대 3개까지 첨부 가능합니다.)
    .addFormDataPart("images0", "FILE_NAME", RequestBody.create(new File("FILE_PATH"),
    MultipartBody.FORM)) // 이미지 파일을 첨부합니다. (첨부하는 이미지 개수에 맞게 주석 처리를 해주세요.)
    .addFormDataPart("images1", "FILE_NAME", RequestBody.create(new File("FILE_PATH"),
    MultipartBody.FORM)) // 이미지 파일을 첨부합니다.
    .addFormDataPart("images2", "FILE_NAME", RequestBody.create(new File("FILE_PATH"),
    MultipartBody.FORM)) // 이미지 파일을 첨부합니다.
    .build();
    
    Request request = new Request.Builder()
    .url(MMS_SEND_URL)
    .post(requestBody)
    .addHeader("Authorization", "Basic " + authValue)
    .build();
    
    Response response = client.newCall(request).execute();
    
    // Response 를 key, value 로 확인하실 수 있습니다.
    HashMap<String, String> result = new
      Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
      for(String key : result.keySet()) {
      System.out.printf("%s: %s%n", key, result.get(key));
      }
     }
    }
    
                        
    import requests
                          url = 'https://sms.gabia.com/api/send/mms'
                          payload = {'phone': '01000000000',
                          'callback': '15444370',
                          'message': 'MMS TEST MESSAGE',
                          'refkey': 'RESTAPITEST1548722756',
                          'subject': 'MMS TEST SUBJECT',
                          'image_cnt': '2'}
                          files = {('images0': open('','rb'),('images1': open('','rb')}
                          headers = {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('POST', url, headers = headers, data = payload, files = files,
                          allow_redirects=False, timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var options = {
                          'method': 'POST',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/send/mms',
                          'headers': {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          var postData = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"phone\"\r\n\r\n01000000000\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data;
                          name=\"callback\"\r\n\r\n15444370\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"message\"\r\n\r\nMMS TEST
                          MESSAGE\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"refkey\"\r\n\r\nRESTAPITEST1547771538\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"subject\"\r\n\r\nMMS TEST
                          SUBJECT\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"image_cnt\"\r\n\r\n2\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"images0\"; filename=\"{Insert_File_Name}\"\r\nContent-Type:
                          \"{Insert_File_Content_Type}\"\r\n\r\n{Insert_File_Content}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"images1\"; filename=\"{Insert_File_Name}\"\r\nContent-Type:
                          \"{Insert_File_Content_Type}\"\r\n\r\n{Insert_File_Content}\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--";
    
                          req.setHeader('content-type', 'multipart/form-data;
                          boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW');
    
                          req.write(postData);
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/send/mms")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Post.new(url)
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          request["content-type"] = 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
                          request.body = "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"phone\"\r\n\r\n01000000000\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data;
                          name=\"callback\"\r\n\r\n15444370\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"message\"\r\n\r\nMMS TEST
                          MESSAGE\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"refkey\"\r\n\r\nRESTAPITEST1548722726\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition:
                          form-data; name=\"subject\"\r\n\r\nMMS TEST
                          SUBJECT\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data;
                          name=\"image_cnt\"\r\n\r\n2\r\n\"images0\"' = '')\"images1\"' =
                          '')------WebKitFormBoundary7MA4YWxkTrZu0gW--"
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request POST
                          "https://sms.gabia.com/api/send/mms" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          \
                          --form "phone=01000000000" \
                          --form "callback=15444370" \
                          --form "message=MMS TEST MESSAGE" \
                          --form "refkey=RESTAPITEST1547715451" \
                          --form "subject=MMS TEST SUBJECT" \
                          --form "image_cnt=2" \
                          --form "images0=@" \
                          --form "images1=@"
    package main
    
                          import (
                          "fmt"
                          "bytes"
                          "mime/multipart"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/send/mms"
                          method := "POST"
    
                          payload := &bytes.Buffer{}
                          writer := multipart.NewWriter(payload)
                          _ = writer.WriteField("phone", "01000000000")
                          _ = writer.WriteField("callback", "15444370")
                          _ = writer.WriteField("message", "MMS TEST MESSAGE")
                          _ = writer.WriteField("refkey", "RESTAPITEST1548722847")
                          _ = writer.WriteField("subject", "MMS TEST SUBJECT")
                          _ = writer.WriteField("image_cnt", "2")
                          // add your file name in the next statement in place of path
                          file, err := os.Open(path)
                          defer file.Close()
                          part, err := writer.CreateFormFile("file", filepath.Base(path))
                          _, err := io.Copy(part, file)
                          // add your file name in the next statement in place of path
                          file, err := os.Open(path)
                          defer file.Close()
                          part, err := writer.CreateFormFile("file", filepath.Base(path))
                          _, err := io.Copy(part, file)
                          err := writer.Close()
                          if err != nil { fmt.Println(err)}
    
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, payload)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          req.Header.Set("Content-Type", writer.FormDataContentType())
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 잔여 건수 조회
  • 발송 후, 총 잔여 건수를 조회할 수 있습니다. 메시지(sms)와 ARS 건수를 제공합니다.
  • - 잔여 건수 조회 시 Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • GET https://sms.gabia.com/api/user/info
  • HEADERS
  • Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • RESPONSE
  • 성공케이스 {
    "code": "200",
    "message": "Success",
    "data": {
    "gabia_id": "gabia id",
    "sms_id": "sms id",
    "sms_count": "현재 메시지 잔여량"
    "ars_count": "0"
    }
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/user/info",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "GET",
                          CURLOPT_HTTPHEADER => array(
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class userInfo {
                          public static final String USER_INFO_URL = "https://sms.gabia.com/api/user/info"; // 잔여 건수 조회 API
                          URL 입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          accessToken).getBytes(StandardCharsets.UTF_8)); // Authorization Header 에 입력할 값입니다.
    
                          // 잔여 건수 조회 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          Request request = new Request.Builder()
                          .url(USER_INFO_URL)
                          .get()
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          Response response = client.newCall(request).execute();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/api/user/info'
                          payload = {}
                          headers = {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var options = {
                          'method': 'GET',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/user/info',
                          'headers': {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/user/info")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Get.new(url)
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request GET
                          "https://sms.gabia.com/api/user/info" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                        
    package main
    
                          import (
                          "fmt"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/user/info"
                          method := "GET"
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, nil)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 발송 결과 확인
  • 문자 발송 시, 사용자가 지정한 refkey (발송 시 사용한 unique key 값)로 실제 발송 상태를 확인할 수 있습니다.
  • - 발송 결과 확인 시 Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • GET https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952
  • HEADERS
  • Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) Basic DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • PARAMS
  • refkey RESTAPITEST1547168952
    The unique string that when you used send message
  • RESPONSE
  • 성공케이스 { "code": "200",
    "message": "SUCCESS",
    "data": [{
    "log_no": "000000000",
    "sms_refkey": "YOUR_REF_KEY",
    "CODE": "SUCC",
    "MESG": "성공",
    "PHONENUM": "01011112222",
    "DATE": "2022-01-01 00:00:01",
    "TRAN_RSLT": "2",
    "TRAN_PR": "0000000",
    }]
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "GET",
                          CURLOPT_HTTPHEADER => array(
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class resultLog {
                          public static final String RESULT_LOG_URL =
                          "https://sms.gabia.com/api/result_log/byRefkey?refkey="; // 문자 발송 결과 조회 API URL 입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
                          String refKey = "YOUR_REF_KEY"; // 문자 발송 API 호출시 입력한 refkey 값을 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          accessToken).getBytes(StandardCharsets.UTF_8));
    
                          // 문자 발송 결과 조회 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          Request request = new Request.Builder()
                          .url(RESULT_LOG_URL + refKey)
                          .get()
                          .addHeader("Content-Type", "application/x-www-form-urlencoded")
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          Response response = client.newCall(request).execute();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952'
                          payload = {}
                          headers = {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var options = {
                          'method': 'GET',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/result_log/byRefkey?refkey=RESTAPITEST1547168952',
                          'headers': {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Get.new(url)
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request GET
                          "https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                        
    package main
    
                          import (
                          "fmt"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/result_log/byRefkey?refkey=RESTAPITEST1547168952"
                          method := "GET"
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, nil)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }
  • 발신번호 리스트 조회
  • 사용 가능 여부와 관계 없이, 리스트에 있는 모든 발신번호를 확인할 수 있습니다.
  • - 발신번호 리스트 조회 시 Authorization에 'ACCESS TOKEN' 값을 넣어주세요.
  • GET https://sms.gabia.com/api/callback/list
  • HEADERS
  • Authorization Basic base64encode(SMS_ID:ACCESS_TOKEN)
    (예) Basic DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=
  • RESPONSE
  • 성공케이스 {
    "code": "200",
    "message": "SUCCESS",
    "data": [{
    "phone": "010-0000-0000",
    "name": "본인 인증"
    }]
    }
    실패케이스 {
    "code": false,
    "message": "None Header (인증 헤더 값을 설정해주세요.)",
    "code_detail": "None_header"
    }
    {
    "code": "token_verification_failed",
    "message": "토큰 인증에 실패하였습니다. 다시 로그인 해주세요."
    }
    ...
  • <?php
    
                          $curl = curl_init();
    
                          curl_setopt_array($curl, array(
                          CURLOPT_URL => "https://sms.gabia.com/api/callback/list",
                          CURLOPT_RETURNTRANSFER => true,
                          CURLOPT_ENCODING => "",
                          CURLOPT_MAXREDIRS => 10,
                          CURLOPT_TIMEOUT => 0,
                          CURLOPT_FOLLOWLOCATION => false,
                          CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                          CURLOPT_CUSTOMREQUEST => "GET",
                          CURLOPT_HTTPHEADER => array(
                          "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                          ),
                          ));
    
                          $response = curl_exec($curl);
                          $err = curl_error($curl);
    
                          curl_close($curl);
    
                          if ($err) {
                          echo "cURL Error #:" . $err;
                          } else {
                          echo $response;
                          } ?>
    import com.google.gson.Gson;
                          import java.io.IOException;
                          import java.nio.charset.StandardCharsets;
                          import java.util.Base64;
                          import java.util.HashMap;
                          import java.util.Objects;
                          import okhttp3.OkHttpClient;
                          import okhttp3.Request;
                          import okhttp3.Response;
    
                          // 외부 라이브러리 다운로드가 필요합니다. (gradle 기준)
                          // implementation 'com.squareup.okhttp3:okhttp:4.9.3'
                          https://mvnrepository.com/artifact/com.squareup.okhttp/okhttp
                          // implementation 'com.google.code.gson:gson:2.9.0' https://github.com/google/gson
    
                          public class callback {
                          public static final String CALL_BACK_LIST_URL = "https://sms.gabia.com/api/callback/list"; // 발신번호
                          리스트 조회 API URL 입니다.
    
                          public static void main(String[] args) throws IOException {
                          String smsId = "YOUR_SMS_ID"; // SMS ID 를 입력해 주세요.
                          String accessToken = "YOUR_ACCESS_TOKEN"; // ACCESS TOKEN 을 입력해 주세요.
                          String authValue =
                          Base64.getEncoder().encodeToString(String.format("%s:%s", smsId,
                          accessToken).getBytes(StandardCharsets.UTF_8)); // Authorization Header 에 입력할 값입니다.
    
                          // 발신번호 리스트 조회 API 를 호출합니다.
                          OkHttpClient client = new OkHttpClient();
    
                          Request request = new Request.Builder()
                          .url(CALL_BACK_LIST_URL)
                          .get()
                          .addHeader("Authorization", "Basic " + authValue)
                          .addHeader("cache-control", "no-cache")
                          .build();
    
                          Response response = client.newCall(request).execute();
    
                          // Response 를 key, value 로 확인하실 수 있습니다.
                          HashMap<String, String> result = new
                          Gson().fromJson(Objects.requireNonNull(response.body()).string(), HashMap.class);
                          for(String key : result.keySet()) {
                          System.out.printf("%s: %s%n", key, result.get(key));
                          }
                          }
                          }
                        
    import requests
                          url = 'https://sms.gabia.com/api/callback/list'
                          payload = {}
                          headers = {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False,
                          timeout=undefined)
                          print(response.text)
    var https = require('https');
    
                          var options = {
                          'method': 'GET',
                          'hostname': 'sms.gabia.com',
                          'path': '/api/callback/list',
                          'headers': {
                          'Authorization': 'Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc='
                          }
                          };
    
                          var req = https.request(options, function (res) {
                          var chunks = [];
    
                          res.on("data", function (chunk) {
                          chunks.push(chunk);
                          });
    
                          res.on("end", function (chunk) {
                          var body = Buffer.concat(chunks);
                          console.log(body.toString());
                          });
    
                          res.on("error", function (error) {
                          console.error(error);
                          });
                          });
    
                          req.end();
    require "uri"
                          require "net/http"
    
                          url = URI("https://sms.gabia.com/api/callback/list")
    
                          https = Net::HTTP.new(url.host, url.port)
                          https.use_ssl = true
    
                          request = Net::HTTP::Get.new(url)
                          request["Authorization"] = "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
    
                          response = https.request(request)
                          puts response.read_body
    curl --location --request GET
                          "https://sms.gabia.com/api/callback/list" \
                          --header "Authorization: Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc="
                        
    package main
    
                          import (
                          "fmt"
                          "os"
                          "path/filepath"
                          "net/http"
                          "io/ioutil"
                          )
    
                          func main() {
    
                          url := "https://sms.gabia.com/api/callback/list"
                          method := "GET"
    
                          client := &http.Client {
                          CheckRedirect: func(req *http.Request, via []*http.Request) error {
                          return http.ErrUseLastResponse
                          },
                          }
                          req, err := http.NewRequest(method, url, nil)
    
                          if err != nil {
                          fmt.Println(err)
                          }
                          req.Header.Add("Authorization", "Basic
                          DckviEksLs6ZXlKMGVYQWlPaUpLVhiR2NpT2lKU1V6STFOaUo5LmV5SnBjM01pT2lKb2RIUndjenBjTDF3dmMyMXpMbWRoWW1saExtTnZiVnd2SWl3aVlYVmtJam9pWEM5dllYVjBhRnd2ZEc5clpXNGlMQ0pshWFhnT2pBNG5uVkVuLWtnVEJoRGpPeWc=")
    
                          res, err := client.Do(req)
                          defer res.Body.Close()
                          body, err := ioutil.ReadAll(res.Body)
    
                          fmt.Println(string(body))
                          }

전문가와 상담하세요

  • 비지니스솔루션 고객센터
  • 1661-4370
  • 대량발송문의(영업)
  • 02-6948-3769