From 4bfdeed98e3a2d2c993406a36cd66002142776d4 Mon Sep 17 00:00:00 2001 From: wenewzhang Date: Fri, 24 May 2019 10:46:04 +0800 Subject: [PATCH] read snapshots with private memo data --- lib/mixin_bot/api/snapshot.rb | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/mixin_bot/api/snapshot.rb b/lib/mixin_bot/api/snapshot.rb index cd761f7..58743ab 100644 --- a/lib/mixin_bot/api/snapshot.rb +++ b/lib/mixin_bot/api/snapshot.rb @@ -8,14 +8,19 @@ def read_snapshots(options) asset = options['asset'] order = options['order'] - path = 'network/snapshots' - payload = { - limit: limit, - offset: offset, - asset: asset, - order: order - } - client.get(path, params: payload) + # path = 'network/snapshots' + + reqForAuthToken = "/network/snapshots" + reqForAuthToken += "?limit=" + limit + reqForAuthToken += "&offset=" + offset + + + reqForAuthToken += "&asset=" + asset + reqForAuthToken += "&order=" + order + access_token = self.access_token('GET', reqForAuthToken, '') + authorization = format('Bearer %s', access_token) + client.get(reqForAuthToken, headers: { 'Authorization': authorization }) + # client.get(path, params: payload) end def read_snapshot(snapshot_id)