Hi All I am getting an error when I try to request...
# suitetalkapi
n
Hi All I am getting an error when I try to request getList SOAPAction for employee from NetSuite I have attached the request & response, Can anyone help me
b
probably want to double check that your SOAPAction header is correct
n
Hi Here I have attached the header of this request
b
looks good
whats your request body?
the body you uploaded doesnt look like valid soap
n
Actually I tried with envelope but that is also not working so I am trying to request without envelope .. Is it mandatory to send the request with Envelope ?
b
n
Hi Thanks, I tired with envelope as well but still same error - Attached for reference
b
as far as i can tell, your soap action must be wrong
every body you uploaded so far has been invalid soap
since you have not been getting errors about your invalid xml, it must be getting an error from the headers
in this case the SOAPAction
you might want to try a different operation like get
n
Hi, I found in the Audit logs that Token id and secret was invalid but now i changed and we are still getting that error and in audit log it says that invalid signature.
I tried to run in postman client but signature is not changing dynamically, i can see nonce changing dynamically for each call PFA of nonce & prescript
Can you please help me to identify the problem in signature
b
you can try debugging the script by hardcoding the signature to see if it changes
if it doesnt change, your setup is probably wrong somewhere
n
Sure i will check in debugging, but which setup might be wrong is the tokenpassport request or prescript ?
b
the script itself
you want to make sure that whatever is setting the signature environment signature works
if its your script, you change the script to hardcode it to a certain value
c
Have you shared the postman code you're using?
Are you trying to follow this, perchance? https://www.zuar.com/blog/netsuite-api-exploring-soap/
Because if you are, you're using ' instead of backticks ` for basestring and key
b
you have a sharper eye than i do
n
yes i am referring the same blog and changed the ' and not backticks `.. which one we need to use?
c
why change it? just cut and paste the code and the SOAP payload
For your reference anyway, backticks evaluate things inside them, so it has to be backticks
n
yes great it worked .. but i am getting some permission issue which i need to check the logs
c
Remove the
<preferences>
section from your payload
n
yes great CD, it is working now thanks for your help
c
You're welcome
n
thanks for the complete team for guiding me
c
I'll buy some new reading glasses for @battk
n
Hi I need to get internal id from Netsuite based on the created date filter, can anyone help me for request body. I tired with filters but could not get the data i am getting error
b
What have you tried
n
Let me share the screen shot
Here is the request body and response.. I guess my body is wrong but could not identity where i am doing mistake
b
your soap envelope should contain an element representing one of the SOAP Web Services Operations
you have an empty get operation
and a fragment of search operation elements
you should only have one element in your soap body, and it should be the one representing the operation
n
Hi Thanks for your input i have done what you have suggested but still i am getting the error in element
b
copy and paste the actual request in here
at least use ```
n
<ns0:search xmlns:ns0="urn:messages_2017_1.platform.webservices.netsuite.com"> <ns0:searchRecord xmlns:ns2="urn:employees_2017_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:EmployeeSearch"> <ns2:lastModifiedDate operator="within" xsi:type="platformCore:SearchDateField"> <platformCore:searchValue xsi:type="xsd:dateTime">2021-02-10T001617.750Z</platformCore:searchValue> <platformCore:searchValue2 xsi:type="xsd:dateTime">2021-05-18T001617.750Z</platformCore:searchValue2> </ns2:lastModifiedDate> </ns0:searchRecord> </ns0:search>
b
ill need the entire thing
you are having namespace issues
n
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Header> <tokenPassport> <account>{{ACCOUNT}}</account> <consumerKey>{{CONSUMER_KEY}}</consumerKey> <token>{{TOKEN_ID}}</token> <nonce>{{nonce}}</nonce> <timestamp>{{timestamp}}</timestamp> <signature algorithm="HMAC-SHA256">{{signature}}</signature> </tokenPassport> </soapenv:Header> <soapenv:Body> <ns0:search xmlns:ns0="urn:messages_2017_1.platform.webservices.netsuite.com"> <ns0:searchRecord xmlns:ns2="urn:employees_2017_1.lists.webservices.netsuite.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:EmployeeSearch"> <ns2:lastModifiedDate operator="within" xsi:type="platformCore:SearchDateField"> <platformCore:searchValue xsi:type="xsd:dateTime">2021-02-10T001617.750Z</platformCore:searchValue> <platformCore:searchValue2 xsi:type="xsd:dateTime">2021-05-18T001617.750Z</platformCore:searchValue2> </ns2:lastModifiedDate> </ns0:searchRecord> </ns0:search> </soapenv:Body> </soapenv:Envelope>
without this element if i run it is 200 success
b
Copy code
<ns2:lastModifiedDate operator="within" xsi:type="platformCore:SearchDateField">
there is no platformCore namespace
your error message gives you line and column numbers
which is a lot more useful to the person with all the request since they can match lines and columns
n
we should remove platformcore?
b
you could, but you would still receive a namespace related error
Copy code
xsi:type="platformCore:SearchDateField"
is telling the server that your element is a platformCore:SearchDateField from the platformCore namespace
it doesnt know what the platformCore namespace is since you never defined it
if you leave it as
Copy code
xsi:type="SearchDateField"
than you are saying that your element is a SearchDateField from the default namespace, which i think is
<http://employees_2017_1.lists.webservices.netsuite.com|employees_2017_1.lists.webservices.netsuite.com>
there is no SearchDateField in that namespace, so you will get an error
n
oh in that case i cannot use date as a search for this employee API?
b
you can
you need to define what the platform core namespace is
if you are going to build xml by hand, you need to understand namespaces
n
here is the xsd for employee search i am using same namesspace
b
that doesnt really matter, your xsi:type attribute overrides whatever type the element would normally have
c
I don't understand why you're completely changing the request that you know works & removing vital things. The one you cut and pasted from the blog will suffice as a starting point
n
Actually for update i need to get internal id from netsuite so i am trying to take internal id from netsuite system so need to filter with date
I tried adding xmlns:platformCore="urn:core_2017_1.platform.webservices.netsuite.com" in the request still it is error, i referred this guide
b
is is the same error?
on the same line?
n
No not same error but
b
oh good
n
different error
b
your error message is telling you that an EmployeeSearch does not have a lastModifedDate element, which is true
n
yes in that case how do we search by date?
b
take a look at the link
your elements are not at the correct level
n
Yes you are right now i used EmployeeSearchBasic and it is working
thanks @battk