See More

import net.dmcloud.cloudkey.*; import net.dmcloud.util.*; import java.util.Map; import java.util.HashMap; import java.util.ArrayList; public class Example { private static String user_id = "4c1a4d3edede832bfd000002"; private static String api_key = "52a32c7890338770e3ea1601214c02142d297298"; private static String base_url = "http://sebest.api.dev.int.dmcloud.net"; public static void mediaList() { try { CloudKey cloud = new CloudKey(user_id, api_key, base_url, CloudKey.CDN_URL, ""); DCObject result = cloud.call ( "media.list", DCObject.create() .push("fields", DCArray.create() .push("id") .push("meta.title") .push("assets.jpeg_thumbnail_auto.stream_url") .push("assets.mp4_h264_aac.video_width") .push("assets.mp4_h264_aac.video_height") .push("assets.source.download_url") ) ); DCArray list = DCArray.create((ArrayList)result.get("list")); for(int i=0; i map = token3.getRights(); if (map != null ) { for (Map.Entry entry : map.entrySet()) { System.out.println("Right " + entry.getKey() + " -> " + entry.getValue()); } } } catch(Exception e) { e.printStackTrace(); System.out.println("oups"); System.out.println(e); } } public static void getApiKey() { String ck_user_id = "4c1a4d3edede832bfd000000"; String ck_api_key = "59f7d6fca9080ec7b59b83eab00e104e3d3d2789"; CloudKey cloudkey = new CloudKey(ck_user_id, ck_api_key, base_url, CloudKey.CDN_URL, ""); DCObject ck_obj = DCObject.create() .push("id", user_id) .push("fields", DCArray.create() .push("id") .push("api_key") .push("streaming_active") .push("is_active") .push("permissions") ); try { DCObject result = cloudkey.call("user.info", ck_obj); System.out.println(result.get("api_key")); } catch (DCException e) { System.out.println(e); } } public static void main(String[] args) { //mediaList(); testToken(); //getApiKey(); } }