Indico API : import room reservation

Hello,
As we are planning to migrate our reservation system to indico, I was looking forward importing the existing reservations to the indico server.

I tried reading room reservations :
https://my-indico.fr/export/reservation/LOCATION.json?ak=<ak>&detail=reservation&from=today&to=today&pretty=yes

It worked.

Trying to call this with Postman or Python/requests, i get a 401 answer :


Error: 401 - <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Unauthorized</title>
</head><body>
<h1>Unauthorized</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
</body></html>

I tried using a token instead of the AK :

url = "https://my-indico.fr/export/reservation/LOCATION.json"

params = {
    'detail': 'reservation',
    'from': 'today',
    'to': 'today',
    'pretty': 'yes'
}

headers = {
	'Authorization': 'Bearer indp_...',
}

response = requests.get(url, params=params, headers=headers)

But this would also return a 401.

Thanks if you can help me out on making this API work…

Which scopes did you grant to that bearer token?

Tried with write only (for POST) or with Everything (all methods) (for GET and POST).
Tokens are displayed as “never used” in profile.

you need to use the api-specific scope

Sorry, i’m not sure what do you exactly mean here ?

Is there other things than this box to tick ?

(Red the doc again, and probably the classic API is not necessary)

You are trying to read, (requests.get), but you want to write, so you need to use request.post

Yes indeed, the screenshot is on the get set up (to check if at least get would be successful). I’m trying with post/get as i change the endpoint i’m trying to access.

that api doesn’t support writing…

and you neec the “classic api” scope on your token

So to send message with this end point, it’s just Classic API (write only) ?
Trying with this set up :

url = "https://my-indico.fr/api/roomBooking/bookRoom.json"

params = {
    'username' : 'admin-indico',
    'from': '2026-12-30T21:30',
    'to': '2026-12-30T22:15',
    'reason': 'meeting',
    'location' : 'LOCATION',
    'roomid' : 7
}

headers = {
	'Authorization': 'Bearer <token>',
}

response = requests.post(url, params=params, headers=headers)
print(response.url)
if response.status_code == 200:
    data = response.json()
    print(data)
else:
    print(f"Error: {response.status_code} - {response.text}")

Get me the same 401 response.

Tried with any combination of token authorisation (write classic/everything, read (when i try with a get to get reservation of day…)).

So do you mean i can’t write room bookings this way ? I based my test on :

Sorry to bother you but I’m not getting it.

You need these two scopes to access any of the classic/legacy endpoints that are documented as part of the “HTTP API”:

  • Classic API (read only)
  • Classic API (write only)

The first one will allow you to GET the api endpoints in /export/...
The second one will allow you to POST the api endpoint in /api/... to create a booking (I had misread your original question and thought you want to import data into some other system from Indico).

That said, these APIs are all VERY legacy and may not support all room booking functionality (I think I wrote most of these old APIs over 10 years ago). Unless that bookRoom endpoint is sufficient for you,.it may be better to look at the requests sent when using the room booking web interface and replicate these (using the “Everything (all methods)” scope).

1 Like