Skip to content

Webhook configurations removed #916

Closed
@julianblue

Description

@julianblue

Hi,

I am trying to create order requests and pass a webhook url along.
By using the below code I receive a dictionary that includes the notification info.

if notification:
            notifications = order_request.notifications(
                webhook_per_order=True,
                webhook_url="https://gvh6r5vpajgsyx5gtgfcww2wgu0jkkzr.lambda-url.eu-central-1.on.aws/",
                email=False,
            )

        request = order_request.build_request(
            order_uuid,
            products=products,
            tools=tools,
            notifications=notifications if notifications else None,
        )

Here is the output

{'name': '85d30923-a7fe-4827-b1f2-dfe41b204100',
 'products': [{'item_ids': ['20230315_010037_23_2479',
    '20230315_010039_44_2479',
    '20230315_002318_33_241d'],
   'item_type': 'PSScene',
   'product_bundle': 'analytic_8b_sr_udm2'}],
 'notifications': {'webhook_url': '<placeholder>',
  'webhook_per_order': True},
 'tools': [{'clip': {'aoi': {'type': 'Polygon',
     'coordinates': (((140.3887524, 35.6184291),
       (140.3886867, 35.6179788),
       (140.3886813, 35.6179189),
       (140.3890716, 35.6178775),
       (140.3891265, 35.6182612),
       (140.3890541, 35.6182688),
       (140.3890662, 35.6183953),
       (140.3887524, 35.6184291)),)}}}]}

Once I submit the order request the response is missing the notification settings

{'_links': {'_self': 'https://api.planet.com/compute/ops/orders/v2/7e73a5b7-c9c1-46be-a811-0519b095648e'},
 'created_on': '2023-04-12T12:39:14.249Z',
 'error_hints': [],
 'id': '7e73a5b7-c9c1-46be-a811-0519b095648e',
 'last_message': 'Preparing order',
 'last_modified': '2023-04-12T12:39:14.249Z',
 'name': '85d30923-a7fe-4827-b1f2-dfe41b204100',
 'notifications': {},
 'products': [{'item_ids': ['20230315_010037_23_2479',
    '20230315_010039_44_2479',
    '20230315_002318_33_241d'],
   'item_type': 'PSScene',
   'product_bundle': 'analytic_8b_sr_udm2'}],
 'state': 'queued',
 'tools': [{'clip': {'aoi': {'coordinates': [[[140.3887524, 35.6184291],
       [140.3886867, 35.6179788],
       [140.3886813, 35.6179189],
       [140.3890716, 35.6178775],
       [140.3891265, 35.6182612],
       [140.3890541, 35.6182688],
       [140.3890662, 35.6183953],
       [140.3887524, 35.6184291]]],
     'type': 'Polygon'}}}]}

When I manually add them like this

request['notifications'] ={"webhook":{
         "per_order": False,
         "url":"https://gvh6r5vpajgsyx5gtgfcww2wgu0jkkzr.lambda-url.eu-central-1.on.aws/"
      }}

the notification settings are accepted and kept in the submission response. Not sure if I am making a mistake or this is a bug.

Thanks for looking into it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions