I’m getting below error while making simple SOAP r...
# suitetalkapi
c
I’m getting below error while making simple SOAP request from the postman. Any ideas?
b
too hard to tell from a picture of code
c
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>Oauth:token_expired</faultstring>
<detail>
<platformFaults:invalidCredentialsFault xmlns:platformFaults="urn:faults_2022_1.platform.webservices.netsuite.com">
<platformFaults:code>USER_ERROR</platformFaults:code>
<platformFaults:message>Oauth:token_expired</platformFaults:message>
</platformFaults:invalidCredentialsFault>
<ns1:hostname xmlns:ns1="<http://xml.apache.org/axis/>">partners125.prod-iad-na8.core.ns.internal</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
@battk I'm getting this error while making a SOAP request from postman. I'm using oAuth 1.0 but it is saying token expired.
Attached the sample request:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="<http://schemas.xmlsoap.org/soap/envelope/>">
<soap:Body>
<getAll xmlns="urn:messages_2022_1.platform.webservices.netsuite.com">
<record recordType="currency"/>
</getAll>
</soap:Body>
</soap:Envelope>
b
there should be more in there
your request is missing the token passport
c
I’m adding the passport details in the authorization tab in the postman.
b
thats not how soap authentication works
c
Thanks battk. I have all the TokenPassport details in handy but not sure how to make a request from the postman. I had reviewed the articles that you sent but It shows only the details related to token passport details. I have loaded the WSDL file in the postman and I can see the list of webservices operations but struggling to make a request from postman.
b
you are going to need to create a token passport element in your request
and fill in the fields with the calculated values
c
The request should be something like this?
<soapenv:Envelope xmlns:xsd="<http://www.w3.org/2001/XMLSchema>" xmlns:soapenv="<http://schemas.xmlsoap.org/soap/envelope/>" xmlns:urn="urn:<http://messages_2018_2.platform.webservices.netsuite.com|messages_2018_2.platform.webservices.netsuite.com>" xmlns:ns6="urn:<http://customization_2018_2.setup.webservices.netsuite.com|customization_2018_2.setup.webservices.netsuite.com>" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" xmlns:ns13="urn:<http://core_2018_2.platform.webservices.netsuite.com|core_2018_2.platform.webservices.netsuite.com>" xmlns:ns12="urn:<http://sales_2018_2.transactions.webservices.netsuite.com|sales_2018_2.transactions.webservices.netsuite.com>" xmlns:urn1="urn:<http://core_2018_2.platform.webservices.netsuite.com|core_2018_2.platform.webservices.netsuite.com>">
<soapenv:Header>
<urn:preferences></urn:preferences>
<urn:partnerInfo></urn:partnerInfo>
<urn:tokenPassport>
<urn1:account>{{ACCOUNT}}</urn1:account>
<urn1:consumerKey>{{CONSUMER_KEY}}</urn1:consumerKey>
<urn1:token>{{TOKEN_ID}}</urn1:token>
<urn1:nonce>{{nonce}}</urn1:nonce>
<urn1:timestamp>{{timestamp}}</urn1:timestamp>
<urn1:signature algorithm="HMAC-SHA256">{{signature}}</urn1:signature>
</urn:tokenPassport>
</soapenv:Header>
<soapenv:Body>
<addList>
<record xsi:type="ns6:CustomRecord" externalId="TEST">
<ns6:recType internalId="customrecord_sps_package_interface"/>
<ns6:customFieldList>
<urn1:customField xsi:type="urn1:StringCustomFieldRef" scriptId="custrecord_sps_ssccbarcode">
<urn1:value>SO20970</urn1:value>
</urn1:customField>
</ns6:customFieldList>
</record>
</addList>
</soapenv:Body>
</soapenv:Envelope>
b
that depends more on the script and the environmental variables
c
I have added environment variables but I guess for signature, timestamp and nonce, I need to create a script in the postman. Do you know any documentation that makes an SOAP API call from postman?
b
that looks like @michoel’s gist, but the script is old so you would need to know how to update it to use HMAC-SHA256
❤️ 1
c
Thanks battk!
m
had the same problem
had NS support on the phone today, for 1 hr, we checked user record, role, integration record, token, entire postman enviroment setup from scratch, and from Invalid Login Attempt we ended on Token Expired error as well. Going into login audit trial in NS UI, under DETAIL column the error for that was : InvalidSignature Waiting for NS Support for further steps. By the way, all that was in RP not PROD or SB
got it working
c
That's good to know @Marco5 How did you make it work?
If you can provide the steps, it would be helpful for me.
368 Views