Hello! I'm trying to send a post request with suit...
# suitetalkapi
c
Hello! I'm trying to send a post request with suiteql in order to get all items, using javascript fetch. It works fine when I use the url "https://<my_account>.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql", but I get a "401 Unauthorized" error when I add limit and offset to the url (like this : "https://<my_account>.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&amp;offset=1000") and I didn't change anything in the authentication method. Any idea ?
1
a
I am by no means an suiteql expert (just played around with it in the sandbox some time ago). But queries in my case works pretty fine for the similar request right now: {{REST_SERVICES}}/query/v1/suiteql?limit=5&offset=5
Copy code
{
  "q": "SELECT * from item"
}
Can we exclude factors of you environment and query specifics? Can you change limit & offset values and see if anything happens? How do you send requests? Maybe you should try other client like Postman (if you are not using it already)?
b
my guess is that you are using TBA, in which case url parameters are part of the base string used to generate the signature for the authorization header
whatever you are using to generate the authorization header is not upto the job
c
@battk yes, url parameters are used to generate the signature. Is there an other way to do ?
@Alex Pilgun it works perfectly when I use Postman but I have the issue when I try to develop a code using javascript fetch
b
what does your code look like to generate the signature
c
@battk I finally made it work 😊 Thanks for your help ! My mistake was that I included the query parameters in the encoded url to generate signature
🙌 1