Start a Conversation

Unsolved

G

4 Posts

1260

December 8th, 2019 06:00

Networker API

Hi,

I am trying to make Networker REST API call using curl command. I am getting 401 unauthorized error message when trying to using basic authentication using my LDAP service account and password. I am able to login to the NMC console using the same credentials and do all the operations. But getting unauthorized  exception. Do we need to give any permission in Networker for service account for REST API calls? Please suggest.

Thanks,

Rama

 

4 Operator

 • 

1.3K Posts

December 9th, 2019 22:00

@grahanam. 401 means that you are not authenticated which means that the user name and password that you had supplied is not recognized by the API server. Can you describe how you are testing the API ?

4 Posts

December 10th, 2019 02:00

Thanks crazyrov.

We are using curl command to test the Networker API call. we are passing credentials as base 64 encoded username:password as follows:

curl -H "Authorization:Basic [base 64 string of username:password]" "https://networkerserver:9090/nwrestapi/v2/global/protectiongroups" -k -1

Error:

2019-12-08 18:19:40.136 INFO [https-jsse-nio-9090-exec-7] c.e.n.w.WebApiRequest - Request method 'GET', URL 'v3/global/protectiongroups
2019-12-08 18:19:40.146 INFO [https-jsse-nio-9090-exec-7] c.e.n.w.WebApiResponse - Response status Method: 'GET', URI:'v3/global/protectiongroups', Status '401'

With same credentials we are able to login to the NMC web console and do all the required operations.

When we tried to browse the url "https://networkerserver:9090/nwrestapi/v2/global/protectiongroups" and tried to login with same credentails, it is failing and in log showing 401 error.

Are we missing any access permission to service account wrt to Networker REST API .

Please suggest

January 17th, 2022 23:00

Hi @grahanam  How did you add your account into the Networker. Is it appearing in the setup-users tab.

Actually I am able to access the Networker API using the account which I use to log into the Networker.

Please try again. Use get method and proper uri, you should be able to get this.

 

Thanks,

Piyush Verma

No Events found!

Top