You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This API allows the user to retrieve Guestbook Responses for a specific Guestbook within a Collection. Optional pagination parameters can be added to limit the number of results, as this can get very large.
@@ -1298,6 +1320,32 @@ The fully expanded example above (without environment variables) looks like this
1298
1320
1299
1321
curl -X PUT -d 'true' -H "X-Dataverse-key:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx""https://demo.dataverse.org/api/guestbooks/root/1234"
1300
1322
1323
+
Retrieve Guestbook Responses for a Guestbook
1324
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1325
+
1326
+
For more about guestbooks, see :ref:`dataset-guestbooks` in the User Guide.
1327
+
1328
+
In order to retrieve the Guestbook Responses for a Guestbook within a Dataverse collection, you must know the ID if the Guestbook. This API also supports pagination by passing a page limit and an optional offset (starting point). The resulting Json will include 'Next' and 'Prev' urls for navigation as well as the total number of responses.
1329
+
The resulting Json will be more detailed than that of the :ref:`download-guestbook-api` CSV response file by including Guestbook metadata as well as Guestbook Response metadata.
1330
+
1331
+
.. note:: See :ref:`curl-examples-and-environment-variables` if you are unfamiliar with the use of ``export`` below.
TypedQuery<GuestbookResponse> query = em.createQuery("select o from GuestbookResponse as o where o.guestbook.id = " + guestbookId + " order by o.responseTime desc", GuestbookResponse.class);
119
+
if (offset != null) {
120
+
query.setFirstResult(offset);
121
+
}
122
+
if (limit != null) {
123
+
query.setMaxResults(limit);
124
+
}
114
125
115
-
if (guestbookId == null) {
116
-
} else {
117
-
returnem.createQuery("select o from GuestbookResponse as o where o.guestbook.id = " + guestbookId + " order by o.responseTime desc", GuestbookResponse.class).getResultList();
0 commit comments