-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathread-endpoint.html
More file actions
78 lines (76 loc) · 6.79 KB
/
Copy pathread-endpoint.html
File metadata and controls
78 lines (76 loc) · 6.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<title>Dataset Project</title>
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://caltechlibrary.github.io/css/site.css">
</head>
<body>
<header>
<a href="http://library.caltech.edu" title="link to Caltech Library Homepage"><img src="https://caltechlibrary.github.io/assets/liblogo.gif" alt="Caltech Library logo"></a>
</header>
<nav>
<ul>
<li><a href="/">Home</a></li>
<li><a href="../">README</a></li>
<li><a href="../LICENSE">LICENSE</a></li>
<li><a href="../INSTALL.html">INSTALL</a></li>
<li><a href="../user_manual.html">User Manual</a></li>
<li><a href="../about.html">About</a></li>
<li><a href="../search.html">Search</a></li>
<li><a href="https://github.com/caltechlibrary/dataset">GitHub</a></li>
</ul>
</nav>
<section>
<h1 id="read-end-point">Read (end point)</h1>
<p>Interacting with the <strong>datasetd</strong> web service can be
done with any web client. For documentation purposes I am assuming you
are using <a href="https://curl.se/">curl</a>. This command line program
is available on most POSIX systems including Linux, macOS and
Windows.</p>
<p>Retrieve a JSON document from a collection.</p>
<pre><code>`http://localhost:8485/<COLLECTION_ID>/object/<KEY>`</code></pre>
<p>Requires a “GET” HTTP method.</p>
<p>Returns the JSON document for given <code><KEY></code> found in
<code><COLLECTION_ID></code> or a HTTP error if not found.</p>
<h2 id="example">Example</h2>
<p>Curl accessing “t1” with a key of “one”</p>
<pre class="shell"><code> curl http://localhost:8485/t1/object/one</code></pre>
<p>An example JSON document (this example happens to have an attachment)
returned.</p>
<div class="sourceCode" id="cb3"><pre
class="sourceCode json"><code class="sourceCode json"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">{</span></span>
<span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="dt">"_Attachments"</span><span class="fu">:</span> <span class="ot">[</span></span>
<span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">{</span></span>
<span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="dt">"checksums"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="dt">"0.0.1"</span><span class="fu">:</span> <span class="st">"bb327f7bcca0f88649f1c6acfdc0920f"</span></span>
<span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> <span class="dt">"created"</span><span class="fu">:</span> <span class="st">"2021-10-11T11:09:51-07:00"</span><span class="fu">,</span></span>
<span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a> <span class="dt">"href"</span><span class="fu">:</span> <span class="st">"T1.ds/pairtree/on/e/0.0.1/a1.png"</span><span class="fu">,</span></span>
<span id="cb3-9"><a href="#cb3-9" aria-hidden="true" tabindex="-1"></a> <span class="dt">"modified"</span><span class="fu">:</span> <span class="st">"2021-10-11T11:09:51-07:00"</span><span class="fu">,</span></span>
<span id="cb3-10"><a href="#cb3-10" aria-hidden="true" tabindex="-1"></a> <span class="dt">"name"</span><span class="fu">:</span> <span class="st">"a1.png"</span><span class="fu">,</span></span>
<span id="cb3-11"><a href="#cb3-11" aria-hidden="true" tabindex="-1"></a> <span class="dt">"size"</span><span class="fu">:</span> <span class="dv">32511</span><span class="fu">,</span></span>
<span id="cb3-12"><a href="#cb3-12" aria-hidden="true" tabindex="-1"></a> <span class="dt">"sizes"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb3-13"><a href="#cb3-13" aria-hidden="true" tabindex="-1"></a> <span class="dt">"0.0.1"</span><span class="fu">:</span> <span class="dv">32511</span></span>
<span id="cb3-14"><a href="#cb3-14" aria-hidden="true" tabindex="-1"></a> <span class="fu">},</span></span>
<span id="cb3-15"><a href="#cb3-15" aria-hidden="true" tabindex="-1"></a> <span class="dt">"version"</span><span class="fu">:</span> <span class="st">"0.0.1"</span><span class="fu">,</span></span>
<span id="cb3-16"><a href="#cb3-16" aria-hidden="true" tabindex="-1"></a> <span class="dt">"version_hrefs"</span><span class="fu">:</span> <span class="fu">{</span></span>
<span id="cb3-17"><a href="#cb3-17" aria-hidden="true" tabindex="-1"></a> <span class="dt">"0.0.1"</span><span class="fu">:</span> <span class="st">"T1.ds/pairtree/on/e/0.0.1/a1.png"</span></span>
<span id="cb3-18"><a href="#cb3-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb3-19"><a href="#cb3-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">}</span></span>
<span id="cb3-20"><a href="#cb3-20" aria-hidden="true" tabindex="-1"></a> <span class="ot">]</span><span class="fu">,</span></span>
<span id="cb3-21"><a href="#cb3-21" aria-hidden="true" tabindex="-1"></a> <span class="dt">"_Key"</span><span class="fu">:</span> <span class="st">"one"</span><span class="fu">,</span></span>
<span id="cb3-22"><a href="#cb3-22" aria-hidden="true" tabindex="-1"></a> <span class="dt">"four"</span><span class="fu">:</span> <span class="st">"four"</span><span class="fu">,</span></span>
<span id="cb3-23"><a href="#cb3-23" aria-hidden="true" tabindex="-1"></a> <span class="dt">"one"</span><span class="fu">:</span> <span class="dv">1</span><span class="fu">,</span></span>
<span id="cb3-24"><a href="#cb3-24" aria-hidden="true" tabindex="-1"></a> <span class="dt">"three"</span><span class="fu">:</span> <span class="dv">3</span><span class="fu">,</span></span>
<span id="cb3-25"><a href="#cb3-25" aria-hidden="true" tabindex="-1"></a> <span class="dt">"two"</span><span class="fu">:</span> <span class="dv">2</span></span>
<span id="cb3-26"><a href="#cb3-26" aria-hidden="true" tabindex="-1"></a><span class="fu">}</span></span></code></pre></div>
</section>
<footer>
<span>© 2022 <a href="https://www.library.caltech.edu/copyright">Caltech Library</a></span>
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
<span><a href="mailto:library@caltech.edu">Email Us</a></span>
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
</footer>
</body>
</html>