Skip to content

Instantly share code, notes, and snippets.

@mjy
Created December 1, 2020 17:12
Show Gist options
  • Save mjy/2ee33d7f047649a5b79ce3f0f2232a56 to your computer and use it in GitHub Desktop.
Save mjy/2ee33d7f047649a5b79ce3f0f2232a56 to your computer and use it in GitHub Desktop.
A basic request to get specimen data back
require 'json'
require 'csv'
require 'amazing_print'
require 'uri'
require 'net/http'
project_token = 'adhBi59dc13U7RxbgNE5HQ'
URL = 'https://sfg.taxonworks.org/api/v1/'
url = URL + '/collection_objects' + '?project_token=' + project_token
b = URI(url)
object = JSON.parse(::Net::HTTP.get(b))
puts b
ap object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment