Skip to main content

I am using the subscription API for subscribing AOI to Planet but getting BAD Request in response

Request:


POST https://services.sentinel-hub.com/api/v1/dataimport/subscriptions


{
"name": "Headland-HL1",
"collectionId": "4f7d7518-9333-MASKED",
"provider": "PLANET",
"input": {
"bounds": {
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
118.5200492301355,
-20.35358590810601,
0.0
],
[
118.525520243307,
-20.35208216090831,
0.0
],
[
118.5315806188978,
-20.35010044578434,
0.0
],
[
118.5367336293801,
-20.34862457841812,
0.0
],
[
118.5366380365892,
-20.34592213640495,
0.0
],
[
118.5342566976348,
-20.34370844044746,
0.0
],
[
118.5177951152882,
-20.34922553133238,
0.0
],
[
118.5200492301355,
-20.35358590810601,
0.0
]
]
]
},
"properties": {}
},
"data": [
{
"dataFilter": {
"timeRange": {
"from": "2021-12-28T00: 00: 00Z",
"to": "2024-01-30T23: 59: 59Z"
},
"maxCloudCoverage": 100.0
},
"itemType": "PSScene4Band",
"productBundle": "analytic_sr_udm2",
"harmonizeTo": "NONE"
}
],
"planetApiKey": "xxx",
"provider": "PLANET"
}
}

Response:


{

"error": {

"status": 400,

"reason": "Bad Request",

"message": "Band mismatch. Ordered [band "B1" (source = "B1", bandIndex = 1 and bitDepth = 16), band "B2" (source = "B2", bandIndex = 1 and bitDepth = 16), band "B3" (source = "B3", bandIndex = 1 and bitDepth = 16), band "B4" (source = "B4", bandIndex = 1 and bitDepth = 16), band "UDM" (source = "UDM", bandIndex = 1 and bitDepth = 😎, band "UDM2_Clear" (source = "UDM2_Clear", bandIndex = 1 and bitDepth = 😎, band "UDM2_Cloud" (source = "UDM2_Cloud", bandIndex = 1 and bitDepth = 😎, band "UDM2_Confidence" (source = "UDM2_Confidence", bandIndex = 1 and bitDepth = 😎, band "UDM2_HeavyHaze" (source = "UDM2_HeavyHaze", bandIndex = 1 and bitDepth = 😎, band "UDM2_LightHaze" (source = "UDM2_LightHaze", bandIndex = 1 and bitDepth = 😎, band "UDM2_Shadow" (source = "UDM2_Shadow", bandIndex = 1 and bitDepth = 😎, band "UDM2_Snow" (source = "UDM2_Snow", bandIndex = 1 and bitDepth = 8)] but collection contains [band "B1" (source = "B1", bandIndex = 1 and bitDepth = 16), band "B2" (source = "B2", bandIndex = 1 and bitDepth = 16), band "B3" (source = "B3", bandIndex = 1 and bitDepth = 16), band "B4" (source = "B4", bandIndex = 1 and bitDepth = 16), band "UDM" (source = "UDM", bandIndex = 1 and bitDepth = 😎, band "UDM2_Clear" (source = "UDM2_Clear", bandIndex = 1 and bitDepth = 😎, band "UDM2_Cloud" (source = "UDM2_Cloud", bandIndex = 1 and bitDepth = 😎, band "UDM2_Confidence" (source = "UDM2_Confidence", bandIndex = 1 and bitDepth = 😎, band "UDM2_HeavyHaze" (source = "UDM2_HeavyHaze", bandIndex = 1 and bitDepth = 😎, band "UDM2_LightHaze" (source = "UDM2_LightHaze", bandIndex = 1 and bitDepth = 😎, band "UDM2_Shadow" (source = "UDM2_Shadow", bandIndex = 1 and bitDepth = 😎, band "UDM2_Snow" (source = "UDM2_Snow", bandIndex = 1 and bitDepth = 8)]",

"code": "COMMON_BAD_PAYLOAD"

}

}

Problem is that the collection was already being used for analytic_sr_udm2 data and the message in response



“message”: Band mismatch. Ordered … vs collection contains …



itself show the same band configuration. So there shouldn’t be an issue with subscription.

I have tried the similar collection for subscription with the web portal there it created the subscription successfully but via API it is throwing the error.

Hi,


thank you for reporting the problem. It was a mis-configuration in our service and it is fixed now. Please try again with the same request and it should work now.


Thanks ordering is resolved.

Another issue came up in subscription confirmation API.

Request:

POST https://services.sentinel-hub.com/api/v1/dataimport/subscriptions/{subscription_id}/confirm


Response:


 
"error": {

"status": 400,

"reason": "Bad Request",

"message": "{\"error\":{\"reason\":\"Source issue\",\"details\":[\"catalog: Published DateRangeFilter 'gt' or 'gte' value must be in the future\"]}}",

"code": "COMMON_BAD_PAYLOAD"

}

}

Although the timeRange I have in the subscription_id e4d4ee30-MASKED is


"timeRange": {
"from": "2021-12-28T00:00:00Z",
"to": "2024-01-30T23:59:59Z"
},

Also I would like to know how can I better manage the past dates images too via subscription API. I am thinking that the timeRange should allow from to be a past datetime.

Setting "from" to a past date was giving similar error while creating subscription.


Hi,


you are correct that a past datetime in “from” should work. Your request is being rejected because of a mis-configuration of your account at Planet. We have asked them yesterday to fix it and will notify you when we get any news from them.


Hi,


should be fixed now.


Reply