Skip to main content
Version: 1.15

Create Order REST

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

This section describes how to order one or many products from the order service through REST interfaces.

Introduction

The diagram below explains the global processing of an Order 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 an order request to REGARDS.
  3. Retrieve order status and available files.
  4. When one or many files are available(s), you can download them.
  5. Repeat again until end of order : retrieve order status, download available files...

sequence

Submit Order request

Request

descriptionurlverb
Product order request<HOST>/api/v1/rs-order/user/orders/applyPOST

Request headers

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

Request body

{
"queries": [],
"filters": {
"dataTypes": [],
"filenameRegExp" : "",
}
}
ParameterTypeOptionalDescription
queriesLucene stringsNoList of lucene formatted queries to find products to order.
filters.datatypesStringYesList of REGARDS datatypes to filter files from ordered products. Datatypes can be RAWDATA or QUICKLOOK
filters.filenameRegExpStringYesRegular expression to filter files by their names from ordered products.

NOTE: Here is the link to the REGARDS Lucene format

Response

Http statusdescription
201Your order request is successfully created
403Access denied
422Invalid request body
{
"orderId" : 54,
"status": "GRANTED"
}

Examples

If you want to retrieve a product by its identifier, the order request is :

{
"queries": [
"productId:my_product_identifier"
]
}

If you want to retrieve many products by their identifiers, the order request is :

{
"queries": [
"productId:(my_product_id_1 OR my_product_id_2 OR my_product_id_3 OR my_product_id_4)"
]
}

If you want to retrieve all products from a specific metadata like datatype (depends on configured REGARDS data models), the order request is:

{
"queries": [
"datatype:type1"
]
}

If you want to retrieve all products from a specific metadata like datatype (depends on configured REGARDS data models) and retrieve only image files, the order request is:

{
"queries": [
"datatype:type1"
],
"filters": {
"dataTypes": [
"QUICKLOOK"
],
}
}

Click on the link Get Order status REST just below, you will discover how to retrieve Order and availables ordered files.