alfio-event / alf.io

alf.io - The open source ticket reservation system for conferences, trade shows, workshops, meetups
https://alf.io
GNU General Public License v3.0
1.42k stars 346 forks source link

API Key Authorization for Tickets List Endpoint #1373

Open kmiskiewicz opened 3 months ago

kmiskiewicz commented 3 months ago

Hi, thank you for your amazing work. I hope you could help me with one issue.

I'd like to use the following endpoint through the API:

/admin/api/reservation/{purchaseContextType}/{publicIdentifier}/reservations/list

I attempted to call it using the API, but it doesn't work with the API key; it only works with the cookie. Below is the cURL command I used:

curl 'https://xxxxx.xxx/admin/api/reservation/event/test-event/reservations/list?page=0&search=&status=COMPLETE' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'cache-control: no-cache' \
  -H 'cookie: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

Could it be possible to authorize this endpoint with the API key instead of the cookie?

Is your feature request related to a problem? Please describe.

I need to be able to export tickets in an automated way to push them into a central system, which processes tickets from various channels. Currently, I am unable to access the endpoint using an API key, which makes it difficult to integrate this functionality into our automated workflows.

Describe the solution you'd like

I would like the endpoint /admin/api/reservation/event/test-event/reservations/listto accept API key authorization.

Describe alternatives you've considered

As an alternative, I have tried using cookie-based authentication, but it is not feasible for automated processes

cbellone commented 3 months ago

Hi @kmiskiewicz ,

this definitely make sense, thank you for the suggestion.

However, we usually add new (suggested) features to public APIs if:

Let me know what would work better for you

Celestino

kmiskiewicz commented 3 months ago

Thx. To be honest, both options could be OK. Perhaps it would be good to have a quick call sometime next week (I've just returned from holiday and need a couple of days to catch up). Do you have a form or email where I could elaborate on what we do, our plans, and our needs?

cbellone commented 2 months ago

Hi, sure! Please reach out to hello _at_ alf.io so that we can schedule a call.

Looking forward to hear from you! Celestino