Skip to content

Commit

Permalink
Add documentation for REST API PO endpoint (#234)
Browse files Browse the repository at this point in the history
Added documentation for the REST API endpoint for creating new physical
objects.
  • Loading branch information
anvit committed Oct 31, 2023
1 parent b62a20b commit dfd0583
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
38 changes: 38 additions & 0 deletions dev-manual/api/add-po.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.. _api-add-po:

================================
Add physical object endpoint
================================

**POST /api/informationobjects**

This endpoint will allow adding a :term:`physical object`.

.. _add-po-ex-req:

Example request
===============

.. code-block:: none
curl -v -X POST http://localhost:63001/api/physicalobjects -H 'Content-Type: application/json' -H 'REST-API-Key: 3e136949f7b9b915' -d '{ "name": "T-01", "location": "Example location", "type": "Shelf" }'
.. _add-po-ex-resp:

Example response
================

Example response is truncated and edited for readability.

.. code-block:: none
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Cache-Control: private
{"slug":"t-01"}
:ref:`Back to top <api-add-po>`
2 changes: 2 additions & 0 deletions dev-manual/api/api-intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ parameters. There are three endpoints available:
* :ref:`Browse taxonomy terms <api-browse-taxonomies>`
* :ref:`Browse information objects <api-browse-io>`
* :ref:`Read information object <api-read-io>`
* :ref:`Download digital objects <api-download-do>`
* :ref:`Add physical objects <api-add-po>`

.. _api-intro-i18n:

Expand Down
1 change: 1 addition & 0 deletions dev-manual/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ set of links to each chapter's main sections.
api/browse-io
api/read-io
api/download-do
api/add-po

:ref:`Back to top <dev-manual-index>`

0 comments on commit dfd0583

Please sign in to comment.