Ad Widget

Collapse

Receiving data from JSON API using HTTP agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kgaurav472
    Junior Member
    • Feb 2021
    • 2

    #1

    Receiving data from JSON API using HTTP agent

    Hi All,

    I am trying to use Rest API of one of our WAF devuces to get data to Zabbix.
    We have succesfully used POST method to send our credential and we have started receiving the token for the same using zabbix.

    token eg:

    {"token":"eyJwerBSJed29yZCwerknlknlkmUxZmJlNmRj ZTg 5ZTJhZDY4 NjljZDRkZDIzkj4kl4jNzY2IiwidXNlciI6InRl\nY2hzdXBwb 3J0IiwiZXQiOiIxNjEzMTM2OTY3In0=\n"}

    Now we are stuck at the second step where we have to create another item to now use the token and use GET method to recieve data from the device

    We are succesfully able to do the same using Curl command on our server.
    eg.
    curl -X GET "http://<WAF-IP>:8000/restapi/v3.1/services/application_name/servers" -H "accept: application/json" -u "eyJwerBSJed29yZCwerknlknlkmUxZmJlNmRjZTg5ZTJh ZDY4 NjljZDRkZDIzkj4kl4jNzY2IiwidXNlciI6InRl\nY2hzdXBwb 3J0IiwiZXQiOiIxNjEzMTM2OTY3In0=\n:"

    But when we try to pass this token in the Header using Zabbix on clicking test we get 401 error which is the error code for invalid credential.

    What to do. Any snapshot would be appreciated.
Working...