Identifiers can be specified in REST API calls and generated either automatically using the internal PID minter or via an external REST service. |
If an identifier has already been generated by an application, you can specify it when creating resources using the PUT method:
PUT /rest/abc123 |
Response:
Status: 201 Created Headers: Location: http://localhost:8080/rest/abc123 |
To have identifiers automatically generated using the internal PID minter, an application can use the POST method:
POST /rest |
Response:
Status: 201 Created Headers: Location: http://localhost:8080/rest/5b6ff353-b4fc-4b9a-8e36-89f74645327b |
Fedora 4 can also be configured to retrieve identifiers from an external HTTP minter service. When a new object or datastream is created using the POST method, an identifier will be created using the external PID minter. See Configuring an External PID Minter.
To use a different identifier generation process, you can create a custom PID minter implementation, which can be configured in the same way as the external PID minter. If your identifiers are generated from an HTTP service, then you should consider extending (or improving) HttpPidMinter.java to meet your needs. Implementing UniqueValueSupplier.java is another option.