Get list of participants through API

Hi,
I need to download automatically for a management system the list of participants of indico events through API.

I’ve generated my own API Token, but now when i try to get the registrants i get an error:

curl -X GET "https://my_indico/export/registrants/eventID.json" -H "Authorization: Bearer my_API_Token"

But i get only error, Is there a way to get this through the API? In the documentation there this sentence:
"
The registrants scope is mainly used by the mobile check-in app and grants access to (currently) undocumented APIs that allow retrieving the list of registrants in an event and and updating their check-in state."

 Thanks for help.

The URL for this API is /api/events/<int:event_id>/registrants. However, I would not use it. It’s obsolete and will eventually be removed.

If you want to use an (undocumented) API it’s better to use the new one (as used by the new checkin app):

/api/checkin/event/<int:event_id>/
/api/checkin/event/<int:event_id>/forms/
/api/checkin/event/<int:event_id>/forms/<int:reg_form_id>/
/api/checkin/event/<int:event_id>/forms/<int:reg_form_id>/registrations/
/api/checkin/event/<int:event_id>/forms/<int:reg_form_id>/registrations/<int:registration_id>

I suggest making calls to these endpoints to see for yourself how the responses look like.