Skip to main content
Version: 2.0

Create product REST

*This page assumes you know how to authenticate your REST API requests *

This section describes how to submit a new product to the Long Term Archive service using the REST interfaces.

Introduction

The diagram below explains the global processing of a new product submission request by REGARDS system.
For a REGARDS client using REST interface, the main steps are:

  1. Authenticate to REGARDS in order to retrieve a valid token. See the authenticate guide.
  2. Send your product archive request containing product information to RS-LTA-MANAGER microservice
  3. Retrieve information about your request status from RS-LTA-MANAGER microservice.

sequence

Submit Product creation request

These two following endpoints shares the same Request headers and Request Body.

descriptionurlverbdocumentation
Product creation request with replace deactivated<HOST>/api/v1/rs-lta-manager/productsPOSTsee REST documentation
Product creation request with replace activated<HOST>/api/v1/rs-lta-manager/products/replacePOSTsee REST documentation

If two products are submitted with the same provider id :

  • if you use the endpoint with replace deactivated, a new version is created (V2, V3...)
  • if you use the endpoint with replace activated, the previous version is replaced
First creation

If that's the first time you submit a product (no product with same providerId is present on OAIS catalog), both endpoint create a first version of the product.

Regards Headers

{
"Content-Type": "application/json",
"Authorization": "Bearer <token>"
}

Request Body

correlationId
required
string [ 0 .. 255 ] characters

Identifier to track this request during the entire workflow. It must be unique.

datatype
required
string [ 0 .. 255 ] characters

Product datatype. Must be present in the lta-manager configuration.

required
Array of objects (ProductFileDto) >= 1 [ items >= 1 ]

Files linked to the product. At least one is required.

object or null (IGeometry)

Product geometry in GeoJSON RFC 7946 Format.

originUrn
string or null [ 0 .. 255 ] characters

Id of the product in the original catalog.

productId
required
string [ 0 .. 255 ] characters

Provider id of the OAIS product to generate.

object or null

Map of key/value properties.

session
string or null [ 0 .. 128 ] characters

Session to monitor the generation of the product. If not provided, a default session will be used.

storePath
string or null [ 0 .. 255 ] characters ^[\w\/\-_:]*$

Path to manually define the destination location for files on archival system. If null, the storePath will be built from the lta-manager configuration.

tags
Array of strings or null or null

List of string tags.

info

If your product creation request contains an error and you have a new payload to send, you can replace the previous request using the product replace endpoint

Difference with AMQP interface

On AMQP interface, there is an additional owner parameter. When you use the REST API, the product owner is automatically set to the logged-in user who sent the submission request.

Integrity

REGARDS system will ensure integrity verification of each file of your product by checking provided md5 checksum after each file copy.

Response

Http statusdescription
200Your request is successfully created
403Access denied
422Invalid request body
{
"content": {
"correlationId": "string",
"productId": "string",
"responseStatus": "GRANTED",
"expires": "2022-12-22T10:25:52.243Z",
"session": "string",
"message": "string"
},
"links": [
]
}
correlationId
required
string

Identifier to track the request through the workflow.

expires
string or null <date-time>

Expiration date of the created request.

message
string or null

Possible error message.

productId
string

Identifier of the submitted product.

responseStatus
required
string
Enum: "GRANTED" "DENIED" "SUCCESS" "ERROR"

Acceptance status of the submitted product.

session
string or null

Session to monitor the created submission request.

info

When you create a product, the responseStatus will either be GRANTED or DENIED

Click on the link Get request status REST just below, you will discover how to retrieve Product creation updates and status.