Solved

appel api centreon_realtime_services

  • 26 April 2022
  • 6 replies
  • 199 views

Badge +3
  • Steward *
  • 30 replies

Bonjour ;
 Je cherche à faire un appel api "action=list&object=centreon_realtime_services" en utilisant un user configurer en autologin.
du coup mon url ressemble à ceci:
 https://xxxxxxx/centreon/api/index.php?action=list&object=centreon_realtime_services&viewType=all&fields=state&search=xxxxx&searchHost=xxxxxxxx&autologin=1&useralias=xxxxxxxx&token=xxxxxxx mais j'obtiens un retour "unauthorized".

avez-vous une solution sans passer par le token?

icon

Best answer by Kriko 27 April 2022, 17:15

View original

6 replies

Userlevel 5
Badge +11

Hi @idi
I suggest you add a screenshot to your post instead of a url link. This would help the community members to better understand your problem, in order to help you find solutions 😉
Regards, 

Badge +3

 

Userlevel 5
Badge +16

Hello @idi ,

It’s mandatory to use the call for authentication:

https://docs.centreon.com/docs/api/rest-api-v1/#authentication

And so use the AuthToken

Badge +3

Bonjour @Kriko 

 

possible de passer par api gorgone pour éviter authenken?

mon besoin d’afficher l’état d’un service en temps réel (centreon_realtime_services) 

Userlevel 5
Badge +16

Not possible too.

You can use both api v1 and v2, but both require auth and token.

Badge +3

ok thank you

Reply