class Freelabster::API

Handles all calls to Freelabster's API.

Public Instance Methods

get_token(urls:) click to toggle source

Get a new token from the API.

Takes an array of URLs to 3D files and returns a hash:

Example:

API.get_token(urls: ["http://example.com/file.stl"])
# => { token: "f00b4r" }
# File lib/freelabster/api.rb, line 11
def get_token(urls:)
  get_token_url = "https://api.freelabster.com/v1/happy3D/getToken"
  HTTP.post(get_token_url, json: { urls: urls }).parse
end