Skip to content

Commit 5a30991

Browse files
committed
Update Create IO API
1 parent f088944 commit 5a30991

1 file changed

Lines changed: 264 additions & 31 deletions

File tree

dev-manual/api/create-io.rst

Lines changed: 264 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,288 @@ Create information object endpoint
88

99
This endpoint will allow creating an :term:`information object`.
1010

11-
The following fields can be in the body of the request for the information
12-
object to be created:
13-
14-
- identifier
15-
- level_of_description_id
16-
- title
17-
- description
18-
- format
19-
- source
20-
- rights
21-
- names
22-
- dates
23-
- notes
24-
- types
25-
- level_of_description
26-
27-
In addition, it can also accept a ``parent_id`` or a ``parent_slug`` field to
28-
add the new information object as a child of an existing one.
29-
30-
The newly created information object uses the default publication status
31-
in the settings, unless the user for the given API key does not have the
32-
permissions to publish in which case the publication status will be set
33-
to draft.
11+
The fields used in the body of the request for the information object
12+
correspond to the header fields used in ISAD CSV imports, see :ref:`csv-import`.
13+
14+
Field parameters
15+
================
16+
17+
Parent information object
18+
-------------------------
19+
20+
``parent_slug`` OR ``parent_id`` - slug or id of the parent information object
21+
to add the new information object as a child of an existing one. If neither is
22+
provided, the new information object will be created under the root.
23+
24+
Free text fields
25+
----------------
26+
27+
``title``
28+
``identifier``
29+
``level_of_description``
30+
``scopeAndContent``
31+
``extentAndMedium``
32+
``locationOfOriginals``
33+
``locationOfCopies``
34+
``accessConditions``
35+
``archivalHistory``
36+
``acquisition``
37+
``revisionHistory``
38+
``arrangement``
39+
``accruals``
40+
``sources``
41+
``appraisal``
42+
``reproductionConditions``
43+
``relatedUnitsOfDescription``
44+
``languageNote``
45+
``publicationNote``
46+
``generalNote``
47+
``archivistNote``
48+
``descriptionIdentifier``
49+
``institutionResponsibleIdentifier``
50+
``rules``
51+
``physicalCharacteristics``
52+
53+
.. code-block:: json
54+
55+
"title": "Example Title"
56+
57+
Digital objects
58+
---------------
59+
60+
``digitalObjectURI`` - URL to an external digital object
61+
62+
.. code-block:: json
63+
64+
"digitalObjectURI": "https://www.example.com/myfile.pdf"
65+
66+
``digitalObjectPath`` - File system path to a local file to be imported as a
67+
digital object
68+
69+
.. code-block:: json
70+
71+
"digitalObjectPath": "/path/to/myfile.pdf"
72+
73+
Publication and description status
74+
-----------------------------------
75+
76+
``publicationStatus`` - Set publication status: ``draft`` or ``published``
77+
78+
.. code-block:: json
79+
80+
"publicationStatus": "published"
81+
82+
``descriptionStatusId`` - Set description status: ``final``, ``draft`` or ``revised``
83+
84+
.. code-block:: json
85+
86+
"descriptionStatusId": "final"
87+
88+
``descriptionDetailId`` - Set description detail level: ``full``, ``minimal`` or
89+
``partial``
90+
91+
.. code-block:: json
92+
93+
"descriptionDetailId": "full"
94+
95+
Language and script fields
96+
---------------------------
97+
98+
``language`` - Two-letter ISO 639-1 language code(s), pipe-separated for multiple
99+
values
100+
101+
``languageOfDescription`` - Two-letter ISO 639-1 language code(s), for the
102+
description itself, pipe-separated for multiple values
103+
104+
``script`` - Four-letter ISO 15924 script code(s), pipe-separated for multiple
105+
values
106+
107+
``scriptOfDescription`` - Four-letter ISO 15924 script code(s), for the
108+
description itself, pipe-separated for multiple values
109+
110+
.. code-block:: json
111+
112+
"language": "en|fr"
113+
"script": "Arab|Latn"
114+
115+
Name access points
116+
------------------
117+
118+
``nameAccessPoints`` - Link actor as name access points
119+
120+
Required fields:
121+
- ``type_id`` - Event type term ID OR ``type`` - Event type name: ``corporate``, ``family``, ``person``
122+
- ``actor_id`` - Existing actor ID OR ``authorized_form_of_name`` - Name to create new actor
123+
124+
.. code-block:: json
125+
126+
"nameAccessPoints": {
127+
"type": "person",
128+
"authorized_form_of_name": "John Smith"
129+
}
130+
131+
Access points
132+
-------------
133+
134+
``placeAccessPoints`` - Array of place terms to link
135+
``genreAccessPoints`` - Array of genre terms to link
136+
``subjectAccessPoints`` - Array of subject terms to link
137+
138+
Each item can include:
139+
- ``id`` - ID of existing term
140+
- ``name`` - Name of place/genre/subject (will create new term if not found)
141+
142+
.. code-block:: json
143+
144+
"placeAccessPoints": [
145+
{"name": "Vancouver"},
146+
{"id": 234}
147+
]
148+
149+
Dates
150+
-----
151+
152+
``dates`` - Array of date information
153+
154+
Each date object can include:
155+
- ``start_date`` - Start date (optional)
156+
- ``end_date`` - End date (optional)
157+
- ``date`` - Display date (optional)
158+
- ``type`` - Date type: ``creation`` (default) or ``accumulation``
159+
160+
.. code-block:: json
161+
162+
"dates": [
163+
{
164+
"start_date": "2020-01-01",
165+
"end_date": "2020-12-31",
166+
"date": "2020",
167+
"type": "creation"
168+
}
169+
]
170+
171+
Actor
172+
-----
173+
174+
``actor`` - Link an actor with an event relationship
175+
176+
Can include:
177+
- ``id`` - Existing actor ID OR ``authorized_form_of_name`` - Actor name (will create new actor if not found)
178+
- ``history`` - Actor history (optional)
179+
- ``event_type_id`` - Event type term ID (optional, defaults to creation)
180+
181+
.. code-block:: json
182+
183+
"actor": {
184+
"authorized_form_of_name": "Jane Doe",
185+
"history": "Photographer active 1990-2020",
186+
"event_type_id": 111
187+
}
188+
189+
Repository
190+
----------
191+
192+
``repository`` - Link to a repository
193+
194+
Must include one of:
195+
- ``slug`` - Slug of existing repository OR ``id`` - ID of existing repository
196+
- ``name`` - Name for new repository (will always create a new repository)
197+
198+
.. code-block:: json
199+
200+
"repository": {
201+
"slug": "example-archives"
202+
}
203+
204+
Accession numbers
205+
-----------------
206+
207+
``accessionNumber`` - Single accession number or array of accession numbers to link
208+
209+
.. code-block:: json
210+
211+
"accessionNumber": "2024-001"
212+
213+
or
214+
215+
.. code-block:: json
216+
217+
"accessionNumber": ["2024-001", "2024-002"]
218+
219+
Alternative identifiers
220+
-----------------------
221+
222+
``alternativeIds`` - Object with alternative identifier values as keys and labels as values
223+
224+
.. code-block:: json
225+
226+
"alternativeIds": {
227+
"alternativeId":"alternativeLabel",
228+
"XYZ789": "Legacy identifier"
229+
}
230+
231+
Level of description
232+
--------------------
233+
234+
``level_of_description_id`` - Term ID for level of description
235+
236+
.. code-block:: json
237+
238+
"level_of_description_id": 123
239+
240+
OR
241+
242+
``level_of_description`` - Level of description name (will be matched against existing terms)
243+
244+
.. code-block:: json
245+
246+
"level_of_description": "Item"
34247
35248
.. _create-io-ex-req:
36249

37250
Example request
38251
===============
39252

40-
.. code-block:: none
253+
.. code-block:: bash
41254
42-
curl -v -X POST http://localhost:63001/api/informationobjects -H 'Content-Type: application/json' -H 'REST-API-Key: 3e136949f7b9b915' -d '{"parent_slug": "example-fonds","title": "Test API Fonds","identifier": "I1","description": "Example description","level_of_description": "Item"}'
255+
curl -v -X POST http://localhost:63001/api/informationobjects \
256+
-H 'Content-Type: application/json' \
257+
-H 'REST-API-Key: 3e136949f7b9b915' \
258+
-d '{
259+
"parent_slug": "example-fonds",
260+
"title": "Test API Fonds",
261+
"identifier": "I1",
262+
"scopeAndContent": "Example description",
263+
"level_of_description": "Item",
264+
"dates": [
265+
{
266+
"start_date": "2024-01-01",
267+
"end_date": "2024-12-31",
268+
"type": "creation"
269+
}
270+
],
271+
"subjectAccessPoints": [
272+
{"name": "History"}
273+
]
274+
}'
43275
44276
.. _create-io-ex-resp:
45277

46278
Example response
47279
================
48280

49-
Example response is truncated and edited for readability.
50-
51-
.. code-block:: none
281+
.. code-block:: bash
52282
53283
HTTP/1.1 201 Created
54284
Content-Type: application/json; charset=utf-8
55285
Transfer-Encoding: chunked
56286
Connection: keep-alive
57287
Cache-Control: private
58288
59-
{"id": 2004281, "slug": "test-api-fonds", "parent_id": 2004230}
60-
289+
{
290+
"id": 2004281,
291+
"slug": "test-api-fonds",
292+
"parent_id": 2004230
293+
}
61294
62-
:ref:`Back to top <api-create-io>`
295+
:ref:`Back to top <api-create-io>`

0 commit comments

Comments
 (0)