想问一下财经大佬,MSCI的ESG评级标准在哪里可以查到?
4个月前 (01-23)
0 点赞
0 收藏
0 评论
8 已阅读
您是不是想找:大佬的365天第季免费观看全集大佬归来假千金她不装了大佬的灌溉日常小说免费阅读顾念大佬总想抢我儿砸 短剧免费观看大佬每天都在上热搜大佬360天第一季免费观看大佬是什么意思大佬池总渣大佬怎么还不逃大佬都爱我
创建 DataAPI 类访问 MSCI ESG 数据 API
class DataAPI API_VERSION = "/v2" BASE_PATH = "https://api.msci.com/esg/report" def initialize(client_id, secret_key) @client_id = client_id @secret_key = secret_key @token = nil end def self.execute(function) res = get(BASE_PATH + API_VERSION + function) puts res.body true end def auth res = post( "https://accounts.msci.com/oauth/token", { "client_id" => @client_id, "client_secret" => @secret_key, "grant_type" => "client_credentials", "audience" => "https://esg/report" } ) puts res.body response = JSON.parse(res.body) return response["error_description"] if response["error"] true endprivate def post(uri, body) uri = URI.parse(uri) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true req = Net::HTTP::Post.new(uri.path) req.body = body.to_json req["Content-Type"] = "application/json" https.request(req) end def get(uri) uri = URI.parse(uri) https = Net::HTTP.new(uri.host, uri.port) https.use_ssl = true req = Net::HTTP::Get.new(uri.path) req["Content-Type"] = "application/json" req["Authorization"] = "Bearer #{@token}" http.request(req) end end endend
还没有任何评论,你来说两句吧