'/' in parameter value failing OAuth1 authentication failure

72 views Asked by At

We are trying to fetch NetSuite API data using a scriptlet. We have a parameter lastModifiedDate which filters the records based on lastModifiedDate. When we pass date in 'MM/dd/yyyy' format, OAuth1 signature is generated, but is resulting Authentication error with 403 error.

https://environment.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1000&deploy=1&lastModifiedDate=1/1/1990"

is generating Authentication error

while

https://environment.restlets.api.netsuite.com/app/site/hosting/restlet.nl?script=1000&deploy=1&lastModifiedDate=1-1-1990

is not giving Authentication error.

We are using OAuthbase.cs to generate the OAuth1 token. Please let us know if any update to be done resolve the issue.

Note: The parameter with lastModifiedDate=1/1/1990 is working properly with Postman

1

There are 1 answers

0
bknights On

Your first example is not a valid url because your date parameter contains invalid characters (the /)

Whatever language you are generating your query string in should have a (library?) function available for encoding query parameters.

e.g.

var dateParam = encodeURIComponent('1/1/1990');

url += '&lastModifiedDate=' + dateParam;

...

would work for javascript.