Anyone successfully paginating through results usi...
# suiteql
b
Anyone successfully paginating through results using the REST API? I can get the call to work in Postman but am doing something wrong in constructing the oauth signature when parameters are involved (i.e. limit, offset). Just looking for some direction or confirmation.
b
whatever you are using for oauth 1 is likely not taking into account url parameters
b
That seems to be the case. I'm using libraries for the hashing and encoding but am constructing the base string myself. I know that the oauth parameters need to be sorted and believe the url parameters are also added and sorted. Trying to find documentation to confirm that.
b
b
Thanks for the link. That at least confirms the base string uri shouldn't include the url parameters. Still looking through to see what I'm missing.
@battk that seems to have done the trick. I was using the complete URL with parameters rather than just the base URL. Thanks for the link to the details.
w
Hi, @Ben Tanner, im experiencing the same.... how did you solve the issue......?
im using oauth 1.0 as well for authentication.... if i add the offset and limit parameters in my postman endpoint i get a response, but in my python requests lib request, im getting an invalid login error, yet if i remove the parameters from the base_url variable using same technique i get a successfull response.... what could i be doing wrongly?
b
are you using Requests-OAuthlib?
b
@wilberforce wairagu ultimately my issue was related to how I was constructing the signature. Specifically I was using the full URL with parameters included rather than just the base URI. It was a mistake made as I coded all the authentication myself. I could have saved a lot of time using an established library but didn't realize that until I was almost done.
w
Uhmm okaay... i've also written all the authentication function by myself... i have a get_signature function which i've tried using my base_url with and without parameters. it fails when i include the parameters... the nonce function which together with the get signature functions are being used in the create my authentication headers in the createheader function. here is a link to my script: https://github.com/willywairagu/suitetalk_auth
b
I think the problem is how the parameters are being handled in your
getSignature
. When setting
signatureValue
the URL should not contain the URL parameters. In your example, the BASE_URL value for
urllib.parse.quote(BASE_URL, safe='~()*!.\'')
will always be "https://<Account ID>.suitetalk.api.netsuite.com/services/rest/record/v1/salesorder". The offset and limit parameters would be added to the
data
string, if they are used.