Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order link and result example #9

Open
lhcorralo opened this issue Nov 4, 2022 · 0 comments
Open

Order link and result example #9

lhcorralo opened this issue Nov 4, 2022 · 0 comments

Comments

@lhcorralo
Copy link

Hi!

Reading the documentation, it says that the link to order an item will be in the links section, with rel=order (well, at least I interpret it). I would consider adding also a proposal for the link.

I know that STAC is using HATEOAS, so the specification at the moment is good ("if rel=order, just shut up and follow that link"), but adding an standard link format would help to implementers.

The href could go like this:

POST http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order

The example is based in the current hierarchy of collections and items, adding another level, and supposing that an order can retrieve a single item. In addition, I think POST is the appropriate method, as sometimes ordering allows, for example, to provide a notification email.

The result of calling to the order link could be also added as part of the order extension. I guess it could be something like this:

{
  "id": "1234-5678-901234567890",
  "links": [
    {
      "rel": "cancel",
      "href": "http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order/1234-5678-901234567890"
    }
  ]
}

Following the above definition, cancelling an order would be done by calling.

DELETE http://<server>/<api_url>/collections/<collection_id>/items/<item_id>/order/<order_id>

Thanks!

Luis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant