How to get acquisition dates using processAPI for sentinel-2-l2a

i am using processAPI to get all the acquisition dates given a certain time series and given that the satellite mission is sentinel-2-l2a

i have the following request and the evalscript ES_AcquisitionDates.
Why i can not retrieve the acquisiton dates?

const req = {
		"input": {
			"bounds": {
			  "geometry": coordsInEPSG3857,
			  "properties": {
				"crs": "http://www.opengis.net/def/crs/EPSG/0/3857"
			  }
			},
			"data": [
			  {
				"dataFilter": {
				  "timeRange": {
					"from": sYear + "-" + sMonth + "-" + sDay + "T" + sHour + ":00:00Z",
					"to": eYear + "-" + eMonth + "-" + eDay + "T" + eHour + ":00:00Z"
				  },
				},
				"type": satMissionType
			  }
			]
		  },
		  "output": {
			"responses": [
				{
					"identifier": "userdata",
					"format": {
						"type": "application/json",
					},
				},
			]
		  },
		  "evalscript": ES_AcquisitionDates(mosaickingType),
		};

ES_AcquisitionDates

function setup() {
  return {
    input: [],
    output: [],
    mosaicking: Mosaicking.${mosaickingType}
  }
}

function updateOutputMetadata(scenes, inputMetadata, outputMetadata) {
  if (scenes) {
    if (scenes.tiles) {
      if (scenes.tiles.length > 0) {

        let acquisitionDates = [];

        for (let i = 0; i < scenes.tiles.length; i++) {
          acquisitionDates.push(scenes.tiles[i].date)
        }
        
        outputMetadata.userData = { metadata: JSON.stringify(acquisitionDates) };

      } else {
        outputMetadata.userData = { metadata: "No tiles data available." };
      }
    } else {
      outputMetadata.userData = { metadata: "No tiles available." };
    }
  } else {
    outputMetadata.userData = { metadata: "No scenes are available." };
  }
}`

Hi Burkhard,

I would advise either using:

  • Catalog API which will return back the metadata you want.
  • This previous example I shared will also return the acquisition dates within the json file returned.

Thank you

I would like to learn how to use process api for that purpose.
Would you please tell me why the request and evalescript I posted in the original question do not work?