Skip to main content
Solved

Access service macro via the v2 API

  • September 15, 2025
  • 4 replies
  • 44 views

Hi,

Is it possible via API to get a service macro field value via the v2 API?

 

Best answer by Alexandre Belhomme

Oh, indeed, i missed the GET part. It’s on me.

I don’t see any response for the macros indeed. Maybe that would be an evolution to ask for as an Idea on the forum.

As a workaround, maybe a database query can return that information.

4 replies

Forum|alt.badge.img+10

Hello, through the PATCH of the service, you have a field called macros that you can provide to update macros at Centreon Web RestAPI


  • Author
  • 266 replies
  • September 17, 2025

Is it possible to get the macro value via this endpoint?

PS: it seems there is a problem with the API documentation. The example says: 
{
  "code": 403,
  "message": "You are not authorized to access this resource"
}

 

 


Forum|alt.badge.img+10

Oh, indeed, i missed the GET part. It’s on me.

I don’t see any response for the macros indeed. Maybe that would be an evolution to ask for as an Idea on the forum.

As a workaround, maybe a database query can return that information.


  • Author
  • 266 replies
  • September 17, 2025

OK thx for the reply.

As a workaround I’m quite sure the v1 API permits that, or at least CLAPI.

But the database query is indeed a possibility too.

Have a nice day