Wednesday, September 02, 2015

How to easily get the IP address of a client calling a Netsuite RESTlet

The Problem:

In order to get a RESTlet to be allowed to access Netsuite you need to give the usual login details but on top of that you need to allow the IP address of the caller to not leave your account open to anybody to try to access your RESTlet. Sometime it is a bit tricky to know the external IP address of the system that you call Netsuite from. I had this issue when developing using c9.io. They gave me a list of of IP addresses but even after adding them to the employee record I was still getting an error message telling me "Invalid login. IP Address does not match any of the IP Address rules specified for this entity.".

The Solution:

On the employee record in Netsuite you are trying to login as, just add the word ALL to the IP rules and save the record. This opens up access for anybody. 


We will only keep this setting for a short while.

Now run your RESTlet call again and and if you now get a proper response instead of an error message go to the login audit trail in Netsuite.



Now click submit and have a look at the list of logins. Find the latest one and you will notice that it has the IP of the RESTlet client logging in.

Now go back to the employee record and replace the word ALL with the actual IP address in the result above.

This time you have the right IP and proper IP based restriction to your account.

No comments:

Post a Comment