adn_viewer 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/adn_viewer.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e2bf07132997c4608a933efe44630de4bad6cce
|
4
|
+
data.tar.gz: 1d1d2dc75bbeaeefd29fdc23840658036685ed12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc79f0256574ce1e3e3f93ab08de956035402ca538e8becd117934e6dc7b988245ec4fb99fe4bee5c82b4b9083f801d76de435036e4ab0bd30ffd1da32c8bb0f
|
7
|
+
data.tar.gz: 1211e7197a77f258797cc7f14593c60541459cdf897e4cd9b9cd2ecf672c86c12ec13d5985ec27d32ab5e6a792aa80d4fb2dc50fbbe6b9b4e033e6242d9009b1
|
data/lib/adn_viewer.rb
CHANGED
@@ -39,4 +39,15 @@ class Adn_Viewer
|
|
39
39
|
puts JSON.parse(http.request(request, file).read_body)
|
40
40
|
end
|
41
41
|
|
42
|
+
def self.register(token, urn)
|
43
|
+
url = URI("https://developer.api.autodesk.com/viewingservice/v1/register")
|
44
|
+
http = Net::HTTP.new(url.host, url.port)
|
45
|
+
http.use_ssl = true
|
46
|
+
request = Net::HTTP::Post.new(url)
|
47
|
+
request["authorization"] = 'Bearer ' + token
|
48
|
+
request["content-type"] = 'application/json'
|
49
|
+
request.body = "{\n \"urn\": \"" + urn + "\"\n}"
|
50
|
+
JSON.parse(http.request(request).read_body)
|
51
|
+
end
|
52
|
+
|
42
53
|
end
|