Hi everyone. New to Zabbix and trying to figure something out.
I am trying to set up a series of HTTP Agent items to test various methods of an API endpoint. The first step is to hit an authorization endpoint to get an auth token, and then use that as the bearer token in all the other methods. I got that to work, but I do not know how to "reference" that value to the test of the items.
I tried setting up a Macro, but I do not see any method of setting the Macros value within the item itself.
I tried updating an Inventory field (i used "Type") with the authentication item, which did work in updating that field to the auth token, but when I tried using the field {INVENTORY.TYPE} inside of the second item, it sent it as a string literal (literally header was sent as "Authorization Bearer {INVENTORY.TYPE} ")
Can anyone point me in the right direction here?
Thanks in advance everyone.
I am trying to set up a series of HTTP Agent items to test various methods of an API endpoint. The first step is to hit an authorization endpoint to get an auth token, and then use that as the bearer token in all the other methods. I got that to work, but I do not know how to "reference" that value to the test of the items.
I tried setting up a Macro, but I do not see any method of setting the Macros value within the item itself.
I tried updating an Inventory field (i used "Type") with the authentication item, which did work in updating that field to the auth token, but when I tried using the field {INVENTORY.TYPE} inside of the second item, it sent it as a string literal (literally header was sent as "Authorization Bearer {INVENTORY.TYPE} ")
Can anyone point me in the right direction here?
Thanks in advance everyone.
Your best option is probably to use script type item, and make those calls in JS there, so you can reference obtained token inside same script...
Comment