cURL JAVA Go PHP NodeJS C# JavaScript python Ruby
Copy curl -X POST https://omni.ibapi.kr/v1/send/naversmart \
-H "content-type: application/json" \
-H "Accept: application/json" \
-H "Authorization:Bearer 발급받은 토큰" \
-d '{"templateCode":"템플릿 코드", "partnerKey":"네이버톡톡 파트너키", "to":"수신번호", "ref":"참조필드"}'
Copy import java . io . * ;
import okhttp3 . * ;
public class Main {
public static void main ( String []args) throws IOException {
OkHttpClient client = new OkHttpClient() . newBuilder ()
. build ();
MediaType mediaType = MediaType . parse ( "application/json" );
RequestBody body = RequestBody.create(mediaType, "{\"templateCode\":\"템플릿 코드\", \"partnerKey\":\"네이버톡톡 파트너키\", \"to\":\"수신번호\", \"ref\":\"참조필드\"}");
Request request = new Request . Builder ()
. url ( "https://omni.ibapi.kr/v1/send/naversmart" )
. method ( "POST" , body)
. addHeader ( "Content-Type" , "application/json" )
. addHeader ( "Accept" , "application/json" )
. addHeader ( "Authorization" , "Bearer 발급받은 토큰" )
. build ();
Response response = client . newCall (request) . execute ();
System . out . println ( response . body () . string ());
}
}