Forum Discussion

rsingh1988_3382's avatar
rsingh1988_3382
Icon for Altostratus rankAltostratus
Dec 14, 2017

iControlRest curl API call fails

Hi All

I am new to iControlRest API and am trying to learn it. I am stuck at very first step i believe and not able to progress further. I am using admin credential here but I am getting http error 401. Not sure what step I am doing wrong any help will be great help.

    [nms~]$ curl -k -u admin:admin -X GET https://10.43.x.x/mgmt/tm/ltm 

    
    
    
    
    Authentication required!
    
    
    

    

    
    Authentication required!
    

    This server could not verify that you are authorized to access
    the URL "/mgmt/tm/ltm".
    You either supplied the wrong credentials (e.g., bad password), or your
    browser doesn't understand how to supply the credentials required.

  


        In case you are allowed to request the document, please
        check your user-id and password and try again.

    

    Error 401
    
      

      Thu Dec 14 15:31:33 2017
      
    
    
    
  • Thank you for the comment but I found the problem and commenting here as it may help beginners like me. Since I had special characters in my admin password curl wasn't accepting them hence i send credentail as a key value pair in string format.

    curl -k -u 'admin:xys@3a' -X GET https://bigipf5/mgmt/ltm

  • Thank you for the comment but I found the problem and commenting here as it may help beginners like me. Since I had special characters in my admin password curl wasn't accepting them hence i send credentail as a key value pair in string format.

    curl -k -u 'admin:xys@3a' -X GET https://bigipf5/mgmt/ltm

  • Hi there,

    First thing first: Can you try accessing the box via ssh (tmsh/bash) and Configuration Utility (GUI)? If they do not work, check if the password is correct.

    Sometimes, restarting the iControl REST processes may help. Run

    tmsh restart sys service restjavad
    (if you are running BIG-IP 11.x, run also
    tmsh restart sys service icrd
    ).